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

Node-Fetch Slow When Using Proxy #459

Open
walmat opened this issue Oct 7, 2019 · 0 comments
Open

Node-Fetch Slow When Using Proxy #459

walmat opened this issue Oct 7, 2019 · 0 comments
Assignees
Labels
area:task-runner Related to Nebula's Task Runner package focus:checkout things involving site checkout (for task runner focus:monitor things involving site monitoring focus:parsing things involving site parsing (for task runner) priority:urgent Issues that need to be solved right away tag:user-feedback Issues that are related to user feedback type:bug Something isn't working

Comments

@walmat
Copy link
Owner

walmat commented Oct 7, 2019

Describe the bug
There have been several reports from users that claimed that node-fetch is really slow when operating behind a proxy. It's fine when using localhost, but it gets laggy when connected to any proxy requiring a TCP connection.

I looked into this and I believe it stems from the HttpsProxyAgent I was using to connect to the proxy. Node fetch by default sets keep-alive to true, but HttpsProxyAgent overrides this when connected to a proxy. This causes the keep-alive to be false, which in turn causes a need for the fetch package to reinitialize the TCP connection every time it calls a request.

To Reproduce
Steps to reproduce the behavior:
I'd list these here, but it's pretty unnecessary imho.

Expected behavior
We should only receive latency when connecting to a proxy that stems from the actual connection the first time and not the re-initialization of the connection every time a request is made.

Screenshots
N/A

Desktop (please complete the following information):

  • OS: ALL
  • Service: Task Runner [GLOBAL]
  • Version: 1.2.35+

Additional context
I'm in favor of switching to axios. It has a similar API and native proxy support that doesn't override the keep-alive header. Any other suggestions, please post them in the comments below!

@walmat walmat added type:bug Something isn't working area:task-runner Related to Nebula's Task Runner package priority:urgent Issues that need to be solved right away tag:user-feedback Issues that are related to user feedback focus:parsing things involving site parsing (for task runner) focus:checkout things involving site checkout (for task runner focus:monitor things involving site monitoring labels Oct 7, 2019
@walmat walmat self-assigned this Oct 7, 2019
@walmat walmat assigned myersjac and ghost Oct 7, 2019
@walmat walmat unassigned ghost Oct 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:task-runner Related to Nebula's Task Runner package focus:checkout things involving site checkout (for task runner focus:monitor things involving site monitoring focus:parsing things involving site parsing (for task runner) priority:urgent Issues that need to be solved right away tag:user-feedback Issues that are related to user feedback type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants