Skip to content

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

@thibauts

Description

@thibauts

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions