Good Evening All,

I am currently trying to make an application in Java which connects via two proxies one a corporate proxy and the other a customer proxy. Like this Java App -----> Corporate Proxy -----> Customer Proxy -----> Customer PC.

What will happen is basically a port will be tunneled on the Customer PC (VNC listening on Port 5900) then this data will then become available via a socket in the Java Application. I need to Relay this data to a port listening on the same machine as the java application such as port 5000 I can then VNC to localhost:5000 and any data sent and received is relayed between the two sockets.

I am not sure if I should use two threads one for send and one for receive to read the bytes and then write the bytes to the other socket. Or is then an easier way by redirecting the outputstream of one socket to the inputstream of another?

I hope that makes sense.

Thank you in advance for your help.

Kindest Regards