Stream for HTTP request / response for web server with HttpCore

I am trying to write a small web server that accepts Http requests and returns Http responses in Java. I use Apache HttpCore and, in particular, I consider HttpServerConnection as the main interface for use in my web server stream.
However, I could not find an example of use on the Internet. I see that there is a receiveRequestHeader method, but I'm not sure when I can use it (do I need to establish a connection first? Is the connection established at creation time? Does this method block?).

Can you provide a short usage example for this class (the implementation I use is DefaultHttpServerConnection ) or suggest a different methodology?

+4
source share
1 answer

The HttpComponents website has two simple http servers among examples . One lock , one non-blocking .

+2
source

All Articles