server / https-proxy: add more debug logs [skip ci]

This commit is contained in:
Brian Mann
2017-10-13 21:25:40 -04:00
parent d0046194a0
commit 628281dd65
4 changed files with 28 additions and 7 deletions
+5 -2
View File
@@ -20,6 +20,8 @@ class Server
connect: (req, socket, head, options = {}) ->
if not head or head.length is 0
log("Writing socket connection headers for URL:", req.url)
socket.once "data", (data) =>
@connect(req, socket, data, options)
@@ -36,7 +38,10 @@ class Server
## if onDirectConnection return true
## then dont proxy, just pass this through
if odc.call(@, req, socket, head) is true
log("Making direct connection to #{req.url}")
return @_makeDirectConnection(req, socket, head)
else
log("Not making direct connection to #{req.url}")
socket.pause()
@@ -67,8 +72,6 @@ class Server
_makeDirectConnection: (req, socket, head) ->
{ port, hostname } = url.parse("http://#{req.url}")
log("Making direct connection to %s:%s", hostname, port)
@_makeConnection(socket, head, port, hostname)
_makeConnection: (socket, head, port, hostname) ->