I'm trying to implement a tcp proxy with python,
So I need to connect two sockets directly, passing input and output in between.
In golang, I simply do a io.Copy
, what's the equivalent in Python 2.6?
go func() {
defer conn1.Close()
defer conn2.Close()
io.Copy(conn1, conn2)
}()