/
README
36 lines (24 loc) · 1.56 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Node SCGI client interface
==========================
This module gives you a (raw) interface for talking to SCGI "servers".
This could be useful, for example, on a mixed environment where Node.js acts
as the frontend serving some kind of requests while something "behind"
could serve some other kind of requests (ie: Python scripts)
At this stage the module is so simple that is not even documented: you can
learn what it does simply reading the one page long code source :)
If you want to try it, just install python-scgi (this is needed by the example
scgi server that you find in the node-sgi directory).
The example scgi server sits on the port 4000 and does nothing more that
saying "hello" (as usual). Running it is just a matter of executing
"python ./node-sgi.py -F" (-F keeps the server on foreground, better for
testing purposes). The server has been hacked over the existing Quixote scgi
server example on the python-scgi Debian distribution.
The scgi module roughly writes and inteprets HTTP headers (on the request
and the response), so be aware of the (quite standard) way it expect them on the
response if you need to modify them. Again, the example scgi server should
be really enough.
Keep in mind that the overall codebase, at the moment, is more or less of proof of concept.
Performances are quite good (about 300 r/s) using a virtualbox Ubuntu linux setup,
and apache's ab benchmark via OSX.
The nodejs server shipped with this module will serve SCGI requests when
the URL contains the /scgi/ pattern. Something like wget http://localhost:8000/scgi/foobar