Skip to content

Conversation

florisvink
Copy link

Emit the tunnel CONNECT response to the parent request. This makes it possible to debug or gain insights in the tunneling process.

Example that logs a response header from the proxy service:

const onTunnelReponse = t => console.log(t.headers['x-proxy-header'])
const onRequest = r => r.once('tunnel_connect_response', onTunnelReponse)

request.get({
    url,
    proxy: `http://${puser}:${ppass}@${phost}`,
    tunnel: true
}).once('request', onRequest)

This also solves #49 (@hashexclude: I think you want the tunnel response per request)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants