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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started