jpillora / go-tcp-proxy

A small TCP proxy written in Go
MIT License
761 stars 197 forks source link

Understanding your project #1

Closed ocrumbs closed 10 years ago

ocrumbs commented 10 years ago

When you say it proxies from localadd to remoteadd, what does that mean? Does that mean, the request to localadd is proxied through the remoteadd ? If so what is the use case for something like this ?

Thanks

jpillora commented 10 years ago

Hi @denmaradi the local address is the local interface and port to bind on. If it is :9999 then it will bind on all interfaces and port 9999. The remote address is where the proxy will connect to. In the examples, I'm creating a proxy with the remote set to echo.jpillora:80 and then I'm connecting the client to localhost:9999 and it reaches echo.jpillora.com:80 via localhost. This example is not very useful for anything other than debugging. Though you could place this on a remote server and use it as a real proxy. See the updated README.

ocrumbs commented 10 years ago

Thanks, it sounds something like proxy pass in nginx