This is a continuation from my last post on creating a web server in Java. The first part went through some basics of the Java NIO API’s…specifically using ServerSocketChannel, Selector, and SelectionKey to setup a thread to asynchronously read and write data to a channel/client.

To try the server, I deployed a sample backbone & marionette app I was working on then using chrome to test it:

Here I have the chrome dev tools opened and we can see all the requests the browser makes to build the html page.

Some server logs

I will add some more details soon. But the goal now is to make the simple web server highly scalable then make it secure through the SSLEngine which has a sample code here: Oracle SSL Engine Demo