summaryrefslogtreecommitdiffhomepage
path: root/src/nodejs/unit-http/http_server.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/nodejs/unit-http/http_server.js')
-rw-r--r--src/nodejs/unit-http/http_server.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/nodejs/unit-http/http_server.js b/src/nodejs/unit-http/http_server.js
index 8eb13d7f..b78f309a 100644
--- a/src/nodejs/unit-http/http_server.js
+++ b/src/nodejs/unit-http/http_server.js
@@ -5,6 +5,7 @@
'use strict';
+const { stderr } = require('process');
const EventEmitter = require('events');
const http = require('http');
const util = require('util');
@@ -413,7 +414,14 @@ ServerRequest.prototype._read = function _read(n) {
};
-function Server(requestListener) {
+function Server(options, requestListener) {
+ if (typeof options === 'function') {
+ requestListener = options;
+ options = {};
+ } else {
+ stderr.write("http.Server constructor was called with unsupported options, using default settings\n");
+ }
+
EventEmitter.call(this);
this.unit = new unit_lib.Unit();