Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emit event on CONNECT response #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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