-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Error: socket hang up with 15.7.0 or newer #37510
Comments
Please provided a minimal repro example. |
works with v15.6.0, doesn't work with v15.10.0 - Error: socket hang up I filled it with free socks5 proxy.
|
Sorry but the sample is unrunnable: Error: SOCKS connection failed. Network unreachable.
at Socket.<anonymous> (/Users/ronagy/GitHub/public/tmp/node_modules/socks5-client/lib/Socket.js:246:25)
at Object.onceWrapper (node:events:483:26)
at Socket.emit (node:events:376:20)
at addChunk (node:internal/streams/readable:311:12)
at readableAddChunk (node:internal/streams/readable:286:9)
at Socket.Readable.push (node:internal/streams/readable:225:10)
at TCP.onStreamRead (node:internal/stream_base_commons:192:23) |
Tried to repro without request (which is no longer maintained): const https= require('http')
const Agent = require('socks5-https-client/lib/Agent');
https.request({
hostname: 'api.myip.com',
method: 'GET',
protocol: 'https:',
agent: new Agent({
socksHost: '195.123.240.73',
socksPort: 1080,
socksUsername: '',
socksPassword: '',
})
}, (err, res) => {
if (err) {
throw err
}
console.error(res.statusCode)
let body = ''
res.on('data', (buf) => {
body += buf
}).on('end', () => {
console.error(body)
})
}) It's just stuck. Not Node related. |
I can confirm it works with Node v15.5.1 but not Node v16. socks5 seems to be messing with Node internals. I think we need help from the package developer to debug this. |
Hi @aicanfly I am interested in fixing this but am busy on some other projects. Would you be willing to submit a PR? |
@aicanfly there are several companies like nearForm that offer paid development services and can do this sort of fix. I am not sure if @ronag or @mcollina (or any other stream maintainers) are up for working on this but you are welcome to shoot them an email to discuss. It's a pretty typical/common format. |
Had the same issue, switched to |
Issue still persisting node --version
v16.13.2 |
Since it appears to be an issue with the library and not node itself, I'm going to close out this issue as non-actionable. |
using https://github.com/mattcg/socks5-https-client combined with request library with node v15.7.0 or newer gives me "Error: socket hang up", with 15.6.0 everything is fine.
The text was updated successfully, but these errors were encountered: