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

Adding connectTimeout setting #1740

Closed
wants to merge 1 commit into from
Closed

Conversation

mattiash
Copy link

I want to use axios to connect to an http-server that is available via several different servers with different url:s. If one of the servers does not respond, I want to try another server instead. To get fast failovers, I want to set a low timeout for the request.

But the server sometimes takes a long time to respond (when I am making a complex query). To give the server time to generate the response, I have to set a high timeout.

What I really want to do is set a low connectTimeout, so that if the server has not accepted the tcp connection within this timeout, the request is aborted, but a high timeout to give the server time to generate the response.

Resolves #1739

@ryouaki
Copy link
Contributor

ryouaki commented Aug 22, 2018

I got a issue with the low response. and i fix it by another way. i dont think this is a good way for fix this problem. because the node event loop system will block some timer at sometime. and error will happend.

@jasonsaayman
Copy link
Member

Hi,

Thank you for this pull request, however it seem that it has gone stale and is either far out of date with the current master head or has unresolved review issues. Should you feel that this pull request is still relevant please submit a new pull request.

Thanks

@Spasfonx
Copy link

It would be so great to have this on master, the code seems really great and the feature is really missing on axios !

@johaven
Copy link

johaven commented Jun 26, 2022

+1

@paolomainardi
Copy link

I noticed the same behavior, I was testing timeout trying to reach an unexisting host and just noticed that Axios just keep the connection open till the end of timeout when it should just fail because network fails.

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.

Allow a connect timeout to be specified
7 participants