summaryrefslogtreecommitdiffstats
path: root/web/attachments/49902-Http.java
blob: 5f2c076b7f108e06e2a7d653d304e6cb63df04dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import java.net.*;
public class Http {
	private static final String EOL = "\r\n";
	public static void main(String args[]) throws Exception {
		ServerSocket server = new ServerSocket(8911);
		while (true) {
			Socket sock = server.accept();
			sock.getOutputStream().write(("HTTP/1.0 " + HttpURLConnection.HTTP_OK + EOL + "Content-type: text/html" + EOL + EOL + "Some example text").getBytes());
			sock.close();
		}
	}
}