Skip to content

Commit

Permalink
Force http socket to connect to loopback address
Browse files Browse the repository at this point in the history
  • Loading branch information
Supereg committed Oct 20, 2020
1 parent 14a6424 commit 8234e7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/util/eventedhttp.ts
Expand Up @@ -496,7 +496,7 @@ export class HAPConnection extends EventEmitter {
this.internalHttpServer.on('close', this.onHttpServerClose.bind(this));

// now we can establish a connection to this running HTTP server for proxying data
this.httpSocket = net.createConnection(this.internalHttpServerPort, addressInfo.address);
this.httpSocket = net.createConnection(this.internalHttpServerPort, getOSLoopbackAddress()); // previously we used addressInfo.address
this.httpSocket.setNoDelay(true); // disable Nagle algorithm

this.httpSocket.on('data', this.handleHttpServerResponse.bind(this));
Expand Down

0 comments on commit 8234e7b

Please sign in to comment.