Question: In this project, you will write a simple HTTP server (in Java) that serves web browsers as its clients. Once your program starts, it opens

In this project, you will write a simple HTTP server (in Java) that serves web browsers as its clients. Once your program starts, it opens a http server socket with port number 9000 and waits for any client connection. After the server starts, it displays (on server side screen) servers ip address, port number and the message that shows the server has started successfully. To complete the project, you have to implement HttpHandler interface and the messages between http server and client are exchanged by using HttpExchange class.

To implement the server, you can simply use high-level Java http server API (com.sun.net.httpserver package). Please refer to Java Doc from Oracle.

When the client connects to your server, your server will send a message back to the client, saying that the server is running without any problem along with HTTP status code 200. To connect to the server from the web browser, you will use server ip address:port number in the address bar to request a connection.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!