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

socket hang up error #22

Open
do-web opened this issue Dec 6, 2017 · 3 comments
Open

socket hang up error #22

do-web opened this issue Dec 6, 2017 · 3 comments

Comments

@do-web
Copy link

do-web commented Dec 6, 2017

`
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.

@kirovilya
Copy link

Hello. Did you solve your error?

@do-web
Copy link
Author

do-web commented Apr 19, 2018 via email

@kirovilya
Copy link

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

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

2 participants