These two classes (HttpServerRequest and HttpServerResponse) are also called as Servlets (as far as I know) ( Don't bother about terminology :) )
So, the following things happen:
1. You receive a request from browser
2. Handle it using HttpServerRequest API's (Don't worry, that request from browser comes as HttpServerRequest object to you)
a. Here, you can get all the headers from the request
b. You can get the POSTed data also if it is POST request
c. I don't know abt HTTPS related things. For this also, API's should be available
3. Now, analyze the request and make the response using HttpServerResponse API's. This is the data that will be sent to browser
a. Here, you can add the headers that you need to send to browser
b. Can add the data part of the HTTP protocol stack
4. That's it. You implemented one webserver
Just this much is tomcat. My project is atleast double the size of this one.
My project is 'Proxy'. In my project also, we have HttpServerRequest and HttpServerResponse classes. These will be used to handle the request coming from browser and to send the response to browser respectively. As 'm 'proxy', we don't have the data that need to be sent to webserver. So, we need to have similar classes that sends this request to webserver and handles the response that comes from webserver.
So, my project is at least double the size of tomcat, right?
Over this, we have much other work to do. Need to change the request that will be sent to webserver and also need to change the response that will be sent to browser.
So, mine is a nice one to learn.... right?