@@ -0,0 +1,2036 @@
+public class Packet%7B%0A%09%0A%09public String content;%0A%09public String host;%0A%09public int port;%0A%0A%09public Packet(String content, String host, int port)%7B%0A%09%09this.content = content;%0A%09%09this.host = host;%0A%09%09this.port = port;%0A%09%7D%0A%7D%0A%0Apublic class Client%7B%0A%09public static void main(String args%5B%5D)%7B%0A%09%09Socket socket;%0A%09%09String HOST = %22www.proxy.com%22%0A%09%09int portNumber = 1888;%0A%0A%09%09Packet p = new Packet(%22Hello%22, %22www.server.com%22,1777);%0A%09%09%0A%0A%09%09socket = new Socket(HOST, portNumber);%0A%09%09ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());%0A%09%09ObjectOutputStream oos = new ObjectOutputStream(socket.getOutputStream());%0A%0A%09%09oos.writeObject(p);%0A%09%09String response = (String) ois.readObject();%0A%09%09System.out.println(response);%0A%0A%09%09ois.close();%0A%09%09oos.close();%0A%09%09socket.close();%0A%09%7D%0A%7D%0Apublic class ProxyServer%7B%0A%09ServerSocket CPsocket;%0A%09int CSportNumber = 1888;%0A%0A%09CPsocket = new ServerSocket(CSportNumber);%0A%09PCsocket = servSocket.accept();%0A%0A%09ObjectOutputStream coos = new ObjectOutputStream(c1Socket.getOutputStream());%0A%09ObjectInputStream cois = new ObjectInputStream(c1Socket.getInputStream());%0A%0A%09Packet p = (Packet) cois.readObject();%0A%0A%09/////////////////////////%0A%09Socket PSsocket;%0A%09PSsocket =new Socket(p.host,p.port);%0A%0A%09ObjectInputStream sois = new ObjectInputStream(socket.getInputStream());%0A%09ObjectOutputStream soos = new ObjectOutputStream(socket.getOutputStream());%0A%0A%09soos.writeObject(p);%0A%09///////////////////%0A%09String response = (String) sois.readObject();%0A%09coos.writeObject(response);%0A%0A%7D%0A%0Apublic class Server%7B%0A%09public static void main(String args%5B%5D)%7B%0A%09%09ServerSocket servSocket;%0A%09%09Socket c1Socket;%0A%09%09int portNumber = 1777;%0A%0A%09%09servSocket = new ServerSocket(portNumber);%0A%09%09c1Socket = servSocket.accept();%0A%0A%09%09ObjectOutputStream oos = new ObjectOutputStream(c1Socket.getOutputStream());%0A%09%09ObjectInputStream ois = new ObjectInputStream(c1Socket.getInputStream());%0A%0A%09%09Packet p = (Packet) ois.readObject();%0A%09%09System.out.println(p.content);%0A%0A%09%09oos.writeObject(%22RECEIVED%22 + p.content);%0A%0A%09%09ois.close();%0A%09%09oos.close();%0A%09%09c1Socket.close();%0A%09%09servSocket.close();%0A%09%7D%0A%7D%0A

Create client_server_proxy.java