Simple SCGI client.
scgi-stream lets you talk to scgi-speaking services without having to go through an intermediate HTTP server.
Available via npm:
$ npm install scgi-stream
Or via git:
$ git clone git://github.com/deoxxa/scgi-stream.git node_modules/scgi-stream
Makes an SCGI request. Returns an
SCGIRequest object. Also does some wiring
for you so that the request returned will emit a
response event when the
response begins to arrive. See the example section below for more information on
how this works.
var scgi = ;scgi;
streamis optionally a stream object. If
streamis not specified,
port, which are a string and a number respectively, will be used to construct a TCP socket.
methodare strings, and
headersis an object with a predictable structure.
Makes an SCGI request. Returns a duplex stream that combines both the request
and response parts of the operation. The stream returned will emit the
event like a regular
SCGIResponse object, but will not emit a
var scgi = ;processstdin;
A duplex stream representing a request.
var req =path: "/"headers:"content-type": "text/plain";req;req;
A duplex stream that parses and represents a response. Emits a
when the headers for the stream have been parsed, then passes through all
var res = ;socket;res;
stream.Transformoptions such as
Also see example.js.
var scgi = ;var req = scgi;req;req;
3-clause BSD. A copy is included with the source.