Comments (8)
Tested on node 10 & 12, same issue.
from proxy-chain.
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.
Many thanks for reporting this, we'll look into it.
from proxy-chain.
Thanks!
Let me know if you need any more info :)
from proxy-chain.
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.
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.
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.
This bug should be fixed in the latest release 0.4.0
, by e454b87
from proxy-chain.
Related Issues (20)
- SOCKS5 support HOT 11
- Passing custom http agent on every prepareRequestFunction HOT 1
- Introduce command line interface to start a local proxy server connect to upstream HOT 2
- Issue with latest stable version 2.2.1 and README about customTag HOT 2
- Linux Mint: Invalid upstream proxy credentials HOT 1
- how can i get origin headers of http request HOT 1
- intercept local requests HOT 2
- Add suport for Bun runtime - Issue with `net.Socket.write` HOT 8
- proxy-chain and puppeteer in same process do not send username and password proxy-authorization HOT 1
- Consider binding HTTP server to a specific hostname HOT 1
- TimeoutError: Navigation timeout of 30000 ms exceeded HOT 9
- Proxy Authentication 407 HOT 3
- Proxy-chain never reconnect when get this error: "Failed to connect to upstream proxy: Error: socket hang up" HOT 5
- getting code 400 for upstream proxy HOT 1
- How do I self sign a request using my certs HOT 1
- Convert "GET" requests to "CONNECT"
- Proxy only certain requests HOT 1
- How to use dynamic upstream proxy pool?
- How to proxy HTTPS? HOT 5
- How to fix/retry on this error "The proxy responded with 590 UPSTREAM503" ? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proxy-chain.