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

ECONNRESET #971

Open
ronag opened this issue Mar 7, 2016 · 3 comments
Open

ECONNRESET #971

ronag opened this issue Mar 7, 2016 · 3 comments

Comments

@ronag
Copy link

ronag commented Mar 7, 2016

I don't understand why I keep getting ECONNRESET with this rather simple proxy:

import httpProxy from 'http-proxy'
import http from 'http'

const proxy = httpProxy.createProxyServer({})

const server = http.createServer((req, res) => {
  console.log(req.url)
  if (req.url.startsWith('/media') || req.url.startsWith('/scene')) {
    proxy.web(req, res, { target: 'http://127.0.0.1:8001' }, err => {
      if (err) {
        console.error(err)
      }
    })
  } else if (req.url.startsWith('/authenticate')) {
    proxy.web(req, res, { target: 'http://127.0.0.1:4223' }, err => {
      if (err) {
        console.error(err)
      }
    })
  } else {
    proxy.web(req, res, { target: 'http://127.0.0.1:9966' }, err => {
      if (err) {
        console.error(err)
      }
    })
  }
})

http.globalAgent.maxSockets = Infinity
server.timeout = 3 * 60 * 60 * 1000 // 3 hours
server.listen(8080)

Not going through the proxy works perfectly.

node-proxy: 1.13.2
node: 5.5.0

@Toon34
Copy link

Toon34 commented Mar 11, 2016

Hi !

I have a same probleme on the specific case !
I upload on my serveur, behind the http-proxy, a large file (250Mo) with a slow connexion 64kb !
And in the specific case, i have a ECONNRESET error !
Without a slow connexion, it's works !
Initially, I thought it was nodejs. So i try all versions and the problem is appear in versin 3.3.0 (iojs) and later (4.x 5.x, so nodejs too). But the manipulation (upload) work without the proxy !

Regards

http-proxy : 1.13.2
node : > 3.3.0
OS linux 3.9.11

@Toon34
Copy link

Toon34 commented Apr 29, 2016

Hi !

Should be fixed by nodejs/node#6284

@aliotta
Copy link

aliotta commented Sep 26, 2023

I am getting a similar error for large file uploads or slow internet connections. Seems to timeout at exactly the 5 minute mark. I ripped out this component and tried with a simple golang reverse proxy and did not hit the same issue so I believe it is this package causing the issue. My express server has a timeout set to 0 and I tried messing with the proxyTimeout and timeout options of this package to no avail.

Is this package still maintained? Seems like the last commit was three years ago and the issues are pilling up.

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

3 participants