| 1 |
# Simple HTTP Proxy |
| 2 |
|
| 3 |
`goproxy-basic` starts an HTTP proxy on :8080. It only handles explicit CONNECT |
| 4 |
requests. |
| 5 |
|
| 6 |
Start it in one shell: |
| 7 |
|
| 8 |
```sh |
| 9 |
goproxy-basic -v |
| 10 |
``` |
| 11 |
|
| 12 |
Fetch goproxy homepage in another: |
| 13 |
|
| 14 |
```sh |
| 15 |
http_proxy=http://127.0.0.1:8080 wget -O - \ |
| 16 |
http://ripper234.com/p/introducing-goproxy-light-http-proxy/ |
| 17 |
``` |
| 18 |
|
| 19 |
The homepage HTML content should be displayed in the console. The proxy should |
| 20 |
have logged the request being processed: |
| 21 |
|
| 22 |
```sh |
| 23 |
2015/04/09 18:19:17 [001] INFO: Got request /p/introducing-goproxy-light-http-proxy/ ripper234.com GET http://ripper234.com/p/introducing-goproxy-light-http-proxy/ |
| 24 |
2015/04/09 18:19:17 [001] INFO: Sending request GET http://ripper234.com/p/introducing-goproxy-light-http-proxy/ |
| 25 |
2015/04/09 18:19:18 [001] INFO: Received response 200 OK |
| 26 |
2015/04/09 18:19:18 [001] INFO: Copying response to client 200 OK [200] |
| 27 |
2015/04/09 18:19:18 [001] INFO: Copied 44333 bytes to client error=<nil> |
| 28 |
``` |
| 29 |
|