package net.zephyrizing.http_server;

public class HttpServer {
    public static void main(String[] args) {
        System.out.println("Hello world!");
    }
}

@@ -35,122 +35,1222 @@
 r;%0A%0A
-public class HttpServer %7B%0A    public static void main(String%5B%5D args) %7B%0A        System.out.println(%22Hello world!%22);
+import java.io.BufferedReader;%0Aimport java.io.InputStreamReader;%0Aimport java.io.PrintWriter;%0Aimport java.net.ServerSocket;%0Aimport java.net.Socket;%0A%0Apublic class HttpServer %7B%0A    public static void main(String%5B%5D args) throws Exception %7B%0A        int portNumber = Integer.parseInt(args%5B0%5D);%0A        System.err.println(%22Starting server on port %22 + args%5B0%5D);%0A%0A        try (ServerSocket listenSocket = new ServerSocket(portNumber)) %7B%0A            System.err.println(%22Listening for clients...%22);%0A%0A            try (Socket socket = listenSocket.accept();%0A                 PrintWriter out = new PrintWriter(socket.getOutputStream(), true);%0A                 BufferedReader in = new BufferedReader(%0A                     new InputStreamReader(socket.getInputStream()));%0A                 BufferedReader stdIn = new BufferedReader(%0A                     new InputStreamReader(System.in))) %7B%0A                System.err.println(%22Connected to client. Proceeding to echo...%22);%0A%0A                String clientInput;%0A                while ((clientInput = in.readLine()) != null) %7B%0A                    System.out.println(%22Got: %22+clientInput);%0A                    out.println(%22Echo: %22+clientInput);%0A                %7D%0A            %7D%0A        %7D
 %0A   

Implement a simple echo server