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

Can't set connect and read timeout before connection is fully established to endpoint #1

Closed
thibauts opened this issue Nov 17, 2013 · 1 comment

Comments

@thibauts
Copy link

With the current implementation I can't get hold of the socket and set a timeout before the proxy connection to the final endpoint has succeeded.

The following code doesn't work because the 'socket' event is emitted too late

req.on('socket', function(socket) {
    socket.setTimeout(5000);
});

This doesn't work either as node's http client propagates the request's setTimeout either after 'connect' or after 'socket' depending on the situation

req.setTimeout(5000);
@TooTallNate
Copy link
Owner

For clarification, how would you do this without using a custom agent object?

kadler15 added a commit to kadler15/node-https-proxy-agent that referenced this issue Sep 25, 2019
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

No branches or pull requests

2 participants