You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
38
38
39
39
Differences:
40
40
- 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
41
41
- 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 }`.
43
43
-`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.
45
45
-`request.trailers` will always be empty: CGI scripts never receive trailers
46
46
-`response.writeContinue()` works as expected but should not be used. See first item
47
47
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.
0 commit comments