socks5-https-client icon indicating copy to clipboard operation
socks5-https-client copied to clipboard

socket hang up error

Open do-web opened this issue 7 years ago • 3 comments

` var form = new FormData();

        form.append('file', fs.createReadStream('./test.jpg'), {
            filename: 'test.jpg',
            contentType: 'image/jpeg'
        });

var req = request({ url: 'https://myserver.com/fileupload', agentClass: Agent, agentOptions: { socksHost: 'torproxy', socksPort: 9050 }, method: 'POST', followRedirect: false, headers: Object.assign({ 'cookie': session.cookies.join(';'), 'user-agent': this.userAgent, 'connection': 'keep-alive', }, form.getHeaders()) })

        form.pipe(req);

        req.on('response', function(response, body) {
            console.log(response.statusCode);

        });

`

I get the fallowing error:

Error: socket hang up at createHangUpError (_http_client.js:343:15) at Socks5ClientSocket.socketOnEnd (_http_client.js:435:23) at emitNone (events.js:105:13) at Socks5ClientSocket.emit (events.js:207:7)

Withouts the socks, all works fine.

do-web avatar Dec 06 '17 20:12 do-web

Hello. Did you solve your error?

kirovilya avatar Apr 19 '18 13:04 kirovilya

Hi use now this https://github.com/do-web/curl-request

do-web avatar Apr 19 '18 16:04 do-web

Hm... console tool for send files... strange... ok, I try it. thank you

kirovilya avatar Apr 19 '18 17:04 kirovilya