Http-server: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 27: Line 27:
* The "listConnections()" JMX management operation lists the active connections and the closed connections, giving information such as remote and local address, creation timestamp, time alive, User-Agent, etc.
* The "listConnections()" JMX management operation lists the active connections and the closed connections, giving information such as remote and local address, creation timestamp, time alive, User-Agent, etc.


* The server has an "OK" handler that responds to any URL with 200 OK, but can introduce delays in processing of a request, if delay=<delay-in-ms> is specified on command line.
* The server has an "OK" handler that responds to any URL with 200 OK, but can introduce delays in processing of a request, if delay=<delay-in-ms> is specified on command line. The command line "delay" configuration is the default value,  and it will be overridden by on a request by request basis, if the request contains a <tt>&delay=<delay-in-ms></tt> query parameter.

Revision as of 04:59, 9 January 2017

Internal

Overview

A simple, multithreaded experimental HTTP/1.1 (RFC 2616) web server. Developed to experiment with the behavior of user agents and proxies.

The server registers itself with the JVM as an MBean, as "novaordis:service=http-server", so it can be managed via a standard JMX client such as VisualVM or JConsole.

GitHub

https://github.com/NovaOrdis/playground/tree/master/http/http-server

Run

./bin/http-server <port> [document-root]

The document-root is optional, it will sever the current directory if not specified.

Features

  • The server assumes HTTP/1.1 persistent connections, as described in HTTP Persistent Connections. The server can be configured to close the connection after the initial request/response sequence by specifying "persistent-connection=false" on the command line.
  • The "listConnections()" JMX management operation lists the active connections and the closed connections, giving information such as remote and local address, creation timestamp, time alive, User-Agent, etc.
  • The server has an "OK" handler that responds to any URL with 200 OK, but can introduce delays in processing of a request, if delay=<delay-in-ms> is specified on command line. The command line "delay" configuration is the default value, and it will be overridden by on a request by request basis, if the request contains a &delay=<delay-in-ms> query parameter.