Hello,
I'm trying to write an application that will basically serve as a tunnel between some servers outside our network and our internal servers. For this I've started using a snippet that creates a tcp listener and then dials to a remote host. Code is shown here:
https://play.golang.org/p/4wjCZFXq6YgThe code works just fine, however every time it gets a new request it dials a new connection to the remote host, and then after all data has been forwarded to both sides it closes them. I'm no expert on networking but this looks like its just opening/closing tcp connections instead of just reusing them, is this correct? if so, what would be the correct way of resuing the connection?
Thanks!