Skip to content
This repository has been archived by the owner on Mar 28, 2019. It is now read-only.

Support for the newer node.js API. #4

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
language: node_js
node_js:
- "6.1"
- "0.10"
- "lts/*"
5 changes: 4 additions & 1 deletion src/_wrapper_shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,10 @@ function safeConnectionWrapper(fn, wrappingSafeConnect) {
wrappingSafeConnect = (wrappingSafeConnect || false);

return function safeConnectionWrappedFn() { // eslint-disable-line max-statements
const args = net._normalizeConnectArgs(arguments);

const normalizeArgs = net._normalizeArgs ? net._normalizeArgs : net._normalizeConnectArgs;

const args = normalizeArgs(arguments);
const options = args[0];

// We smuggled our validator through localAddress
Expand Down
5 changes: 4 additions & 1 deletion src/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ import wrapperShared from './_wrapper_shared';

// Use our custom connection function that won't need a synchronous DNS lookup
function safeConnectionFunc() {
const args = net._normalizeConnectArgs(arguments);

const normalizeArgs = net._normalizeArgs ? net._normalizeArgs : net._normalizeConnectArgs;
const args = normalizeArgs(arguments);

const options = args[0];
const s = new net.Socket(args[0]);
const newOptions = util._extend({}, options);
Expand Down