Skip to content

Instantly share code, notes, and snippets.

@isaacs
Last active December 21, 2015 05:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaacs/6259465 to your computer and use it in GitHub Desktop.
Save isaacs/6259465 to your computer and use it in GitHub Desktop.
diff --git a/lib/_http_client.js b/lib/_http_client.js
index 63f5ee9..b3a4d84 100644
--- a/lib/_http_client.js
+++ b/lib/_http_client.js
@@ -101,7 +101,10 @@ function ClientRequest(options, cb) {
self._renderHeaders());
}
- if (self.socketPath) {
+ if (options.socket) {
+ // someone already did it for us. how thoughtful.
+ self.onSocket(options.socket);
+ } else if (self.socketPath) {
self._last = true;
self.shouldKeepAlive = false;
var conn = self.agent.createConnection({ path: self.socketPath });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment