Skip to content

Commit 504e25a

Browse files
committed
Update README
1 parent a9bae9a commit 504e25a

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,29 @@ fcgi.createServer(function(req, res) {
3434
http module compatibility
3535
-------------------------
3636

37-
The API is almost compatible with http module api v0.10.23
37+
The API is almost compatible with http module from node v0.12 all the way to v6.2 (the current version).
3838

3939
Differences:
4040
- A FastCGI server will never emit `'checkContinue'` and `'connect'` events because `CONNECT` method and `Expect: 100-continue` headers should be handled by the front-end http server
4141
- The `'upgrade'` event is not currently implemented. Typically upgrade/websocket requests won't work with FastCGI applications because of input/output buffering.
42-
- `server.listen()` can be called without arguments to listen on the default FastCGI socket `{ fd: 0 }`
42+
- `server.listen()` can be called without arguments (or with a callback as the only argument) to listen on the default FastCGI socket `{ fd: 0 }`.
4343
- `server.maxHeadersCount` is useless
44-
- `request.socket` is not a real socket. It's an object containing HTTP server and client address and port (localAddress, localPort, remoteAddress, remotePort properties)
44+
- `request.socket` is not a real socket. Read the next section for more information.
4545
- `request.trailers` will always be empty: CGI scripts never receive trailers
4646
- `response.writeContinue()` works as expected but should not be used. See first item
4747

48+
The socket object
49+
-----------------
50+
51+
The socket object exposed in requests and responses implements the `stream.Duplex` interface. It exposes the FastCGI stdin stream (request body)
52+
and translates writes to stdout FastCGI records.
53+
The object also emulates the public API of `net.Socket`. Address fields contain HTTP server and client address and port (`localAddress`, `localPort`, `remoteAddress`, `remotePort` properties and the `address` method).
54+
55+
The socket object exposes three additional properties:
56+
* `params` is a dictionary of raw CGI params.
57+
* `dataStream` implements `stream.Readable`, exposes the FastCGI data stream for the filter role.
58+
* `errorStream` implements `stream.Writable`, translates writes to stderr FastCGI Records.
59+
4860
License
4961
=======
5062

0 commit comments

Comments
 (0)