I want to implement an SSL proxy in Java. I basically open two sockets browser-proxy,proxy-server, and run two threads which would write to p
In order to solve your problem you have to do the following:
OutputStream sockOutOStream = sockout.getOutputStream();
sockOutOStream.write(new byte[0]);
sockOutOStream.flush();
sockout.close();
On the other end the party which reads from the socket will receive the -1-length message instead of SocketException thrown.