This is a rather large refactor! Mostly for the better side. I've had to
remove some functionality like req.interrupt(). A lot of other work is left
messy or incomplete.
The constructor for TCP servers can no longer take a connection handler for
purely technical reasons. (The constructor for EventEmitter is implemented
in C++ but addListener is in javascript, and I don't want to make too many
C++ -> Javascript references.) Thus I introduce new constructor methods to
ease the creation of the servers:
node.tcp.createServer()
node.http.createServer()
These work almost the same as the old constructors.
In general we're working towards a future where no constructors are
publicly exposed or take arguments.
The HTTP events like "on_uri" are not yet using the event interface.
onMessage still is a constructor - but this will change soon.
If users do not send transfer-encoding or content-length headers, then I
will not add any additional. Content-Length: 0 is assumed if there aren't
other headers and chunked encoding is rare.
Instead we're going to just get a single callback for the URI. This can be
parsed additionally in javascript using parseuri:
http://blog.stevenlevithan.com/archives/parseuri
I haven't added that yet, but it will come soon.
The LowLevelServer is a direct interface to the parser given people access
to things like partially received headers. This could be used to implement
an extremely optimized server which acts before parsing is complete.
Most people will be using node.http.Server which is still rather low-level
compared to other http interfaces, but does take care of some details for
you.