joyent/node — Issue #2285: feature request: bind a special local address in net.connect (as a tcp client)
Author: qyb
Created: 2011-12-07 16:31:57+00:00
State: open

tcp server.listen support bind(), but tcp client has no such feature.

in net.js
exports.connect = exports.createConnection = function(port /* [host], [cb] */) {
var s;

if (isPipeName(port)) {
s = new Socket({ handle: createPipe() });
} else {
s = new Socket();
}

return s.connect(port, arguments[1], arguments[2]);
};