Browse Source

cleanup unix socket code

http2
Vsevolod Strukchinsky 9 years ago
parent
commit
abf18da4a0
  1. 11
      index.js

11
index.js

@ -253,19 +253,12 @@ function normalizeArguments(url, opts) {
opts.method = opts.method || 'GET';
// check for unix domain socket
if (opts.hostname === 'unix') {
// extract socket path and request path
var matches = /(.+)\:(.+)/.exec(opts.path);
if (matches) {
var socketPath = matches[1];
var path = matches[2];
// make http.request use unix domain socket
// instead of host:port combination
opts.socketPath = socketPath;
opts.path = path;
opts.socketPath = matches[1];
opts.path = matches[2];
opts.host = null;
}
}

Loading…
Cancel
Save