This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
My programming assignment requires me to create a proxy in between client and server.
My client make a request to server through the proxy, then the proxy forwards it and returns back the response from the server to the client.
Here's the steps I took:
1) get request from client and store the request data into a byte array
2) read from the byte array using buffered reader
3) get the host name from the Host: header field and create a serverSocket with it
4) forward the request data to the serverSocket outputstream
5) retrieve the response data from the serverSocket inputstream into another byte array
6) write contents from the byte array into clientSocket output stream
However, after step 6, the browser is unable to display the response data. Any help?