mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
http: add options to http.createServer()
This adds the optional options argument to `http.createServer()`. It contains two options: the `IncomingMessage` and `ServerReponse` option. PR-URL: https://github.com/nodejs/node/pull/15752 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com>
This commit is contained in:
committed by
Ruben Bridgewater
parent
82a7347050
commit
a899576c97
@@ -65,7 +65,8 @@ See [`http.Server#keepAliveTimeout`][].
|
||||
<!-- YAML
|
||||
added: v0.3.4
|
||||
-->
|
||||
- `options` {Object} Accepts `options` from [`tls.createServer()`][] and [`tls.createSecureContext()`][].
|
||||
- `options` {Object} Accepts `options` from [`tls.createServer()`][],
|
||||
[`tls.createSecureContext()`][] and [`http.createServer()`][].
|
||||
- `requestListener` {Function} A listener to be added to the `request` event.
|
||||
|
||||
Example:
|
||||
@@ -256,6 +257,7 @@ const req = https.request(options, (res) => {
|
||||
[`http.Server#setTimeout()`]: http.html#http_server_settimeout_msecs_callback
|
||||
[`http.Server#timeout`]: http.html#http_server_timeout
|
||||
[`http.Server`]: http.html#http_class_http_server
|
||||
[`http.createServer()`]: http.html#httpcreateserveroptions-requestlistener
|
||||
[`http.close()`]: http.html#http_server_close_callback
|
||||
[`http.get()`]: http.html#http_http_get_options_callback
|
||||
[`http.request()`]: http.html#http_http_request_options_callback
|
||||
|
||||
Reference in New Issue
Block a user