Giter Site home page Giter Site logo

Comments (8)

atymic avatar atymic commented on August 11, 2024

Tested on node 10 & 12, same issue.

from proxy-chain.

atymic avatar atymic commented on August 11, 2024

I've managed a bit of a ghetto fix by adding an error handler on the socket before sending the 407 response.

socket.on('error', (error) => {
	console.log(error)
	socket.end();
	socket.destroy();
});

I added it just about this line:
https://github.com/apifytech/proxy-chain/blob/master/src/server.js#L408

It seems to work ok, but i'm not sure if there's a socket/memory leak in there.
Either way better to fix the actual issue.

from proxy-chain.

jancurn avatar jancurn commented on August 11, 2024

Many thanks for reporting this, we'll look into it.

from proxy-chain.

atymic avatar atymic commented on August 11, 2024

Thanks!

Let me know if you need any more info :)

from proxy-chain.

Flowr-es avatar Flowr-es commented on August 11, 2024

I think this one is the same. If the upstreamProxy receives wrong credentials it fails with logs but no event for the implementor. Or is there anyway to handle this?

Logs:
ProxyServer[3128]: 29 | !!! Closed and removed from server
ProxyServer[3128]: 22 | Connected to upstream proxy
ProxyServer[3128]: 22 | RequestError: Invalid credentials provided for the upstream proxy., responding with custom status code 502 to client
ProxyServer[3128]: 22 | Source response finished, ending source socket
ProxyServer[3128]: 26 | Connected to upstream proxy
ProxyServer[3128]: 26 | RequestError: Invalid credentials provided for the upstream proxy., responding with custom status code 502 to client
ProxyServer[3128]: 26 | Source response finished, ending source socket
ProxyServer[3128]: 28 | Connected to upstream proxy
ProxyServer[3128]: 28 | RequestError: Invalid credentials provided for the upstream proxy., responding with custom status code 502 to client
ProxyServer[3128]: 28 | Source response finished, ending source socket
ProxyServer[3128]: 22 | Source socket finished
ProxyServer[3128]: 22 | Closing handler

from proxy-chain.

jancurn avatar jancurn commented on August 11, 2024

Sorry guys, we didn't manage to get to fixing this. PRs are more than welcome! This should be a simple fix, the unit test might be slightly more complicated but I'd say manageable.

from proxy-chain.

jancurn avatar jancurn commented on August 11, 2024

Another instance of unhandled errors observed in our production system - might be related.

Feb 04 00:38:08 ip-172-31-62-20 [email protected] Emitted 'error' event on Socket instance at:
    at emitErrorNT (internal/streams/destroy.js:92:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: 'ECONNRESET',
  code: 'ECONNRESET',
  syscall: 'read'
}
Feb 04 00:38:08 ip-172-31-62-20 [email protected] [Error] Error: read ECONNRESET
    at TCP.onStreamRead (internal/stream_base_commons.js:201:27)
Feb 04 00:38:08 ip-172-31-62-20 [email protected] events.js:187
      throw er; // Unhandled 'error' event
      ^

from proxy-chain.

jancurn avatar jancurn commented on August 11, 2024

This bug should be fixed in the latest release 0.4.0, by e454b87

from proxy-chain.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.