Emitted events

"request" (error, socket, headers, data)

Is emitted when a complete request is received. You can write your data to socket, be sure to send headers first.

The POST data (if there was any) is sent as array of buffers with "data", and the following postdata will be sent over the socket.
To stop new data going into the array, you can call socket.removeAllListeners('data'). See HTTPapi.js around line 36.

Headers is a function that you can call like headers("name", "encoding"), with encoding being any of the standard node encodings, or "buffer" if you want to get the raw buffer. If not given, it defaults to "ascii".
You can also call headers without arguments, to give you all of the HTTP headers as an object formatted like-so in lower-case.

Changes from v0.0.2

Instead of emitting a 'request' event on the socket, new SCGIServer will now give you an own EventEmitter.

Calling headers without arguments will give you an object like {accept: "text/plain", status: '200 OK'}.

Remove reading of the entire POST data into a Buffer, because the data can be huge, and this can be used as an attack.