Skip to content

Commit aa94219

Browse files
committed
Fix net.createServer to comply with official API
1 parent b056904 commit aa94219

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

TcpSockets.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ var ipRegex = require('ip-regex');
1313
var Socket = require('./TcpSocket');
1414
var Server = require('./TcpServer');
1515

16-
exports.createServer = function(connectionListener: (socket: Socket) => void) : Server {
16+
exports.createServer = function(opts: any, connectionListener: (socket: Socket) => void) : Server {
17+
if (typeof opts === 'function' && !connectionListener) {
18+
return new Server(opts);
19+
}
1720
return new Server(connectionListener);
1821
};
1922

0 commit comments

Comments
 (0)