Only listen on loopback interfaces (#3666)

* https-proxy, server: only listen on loopback for ipv4/v6

* server: use supplied port

* https-proxy, server: remove ::1 listener

* server: add test that all servers only listen on lo, not other interfaces
This commit is contained in:
Zach Bloomquist
2019-03-15 01:01:50 -04:00
committed by Brian Mann
parent 9b8d4c2810
commit 19a63a0f25
4 changed files with 39 additions and 10 deletions
+1 -1
View File
@@ -164,7 +164,7 @@ class Server
@_sniServer.on "upgrade", @_onUpgrade.bind(@, options.onUpgrade)
@_sniServer.on "request", @_onRequest.bind(@, options.onRequest)
@_sniServer.listen =>
@_sniServer.listen 0, '127.0.0.1', =>
## store the port of our current sniServer
@_sniPort = @_sniServer.address().port