Skip to content

Incompatible with Node 4.2.1 #10

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

Closed
dga711 opened this issue Oct 26, 2015 · 7 comments
Closed

Incompatible with Node 4.2.1 #10

dga711 opened this issue Oct 26, 2015 · 7 comments

Comments

@dga711
Copy link

dga711 commented Oct 26, 2015

Can't use it as an agent with request using Node 4.2.1
Example also doesnt work.

Proxy is a TOR proxy.

Edit: The issue is concerning socks5-http-client. But the problem seems to lie in this library.

@dga711
Copy link
Author

dga711 commented Oct 26, 2015

I'm no expert with this but one thing i saw while trying to debug:
The last 2 bytes (Port) of the request to proxy are 0 80 . Shouldn't it be LOWBYTE HIGHBYTE?

But this is probably not what breaks it.

@anderfjord
Copy link

I've run into a similar (or perhaps the same) issue using this module with Tor. The error message I'm getting seems to have something to do with the use of stream.Writable.cork():

TypeError: socket.cork is not a function
at ClientRequest.OutgoingMessage._flush (_http_outgoing.js:642:14)
at _http_client.js:148:10
at Socks5ClientSocket.callSocketMethod (_http_client.js:513:7)
at Socks5ClientSocket.g (events.js:260:16)
at emitNone (events.js:67:13)
at Socks5ClientSocket.emit (events.js:166:7)
at Socks5ClientSocket.handleSocksConnectToHost (/usr/project_directory/node_modules/socks5-http-client/node_modules/socks5-client/lib/Socks5ClientSocket.js:135:7)

I'm not sure why cork() would be an issue, since I believe this was introduced in v0.12, which I was previously using without a problem.

I don't know if this is happening during socket connection (see this thread [https://github.com/nodejs/node/pull/2960#discussion_r41955893]), or during a write, though I have found that if I change self.writeable to false on line 131 of Socket.js [https://github.com/mattcg/socks5-client/blob/master/lib/Socket.js#L131], then I no longer have the issue.

@anderfjord
Copy link

Also, I'm using FreeBSD. Not sure sure if it has anything to do with FreeBSD's use of TCP_NOPUSH in place of Linux's use of TCP_CORK.

@dga711
Copy link
Author

dga711 commented Nov 6, 2015

Thanks for your input.
I don't think its a problem with FreeBSD. I get the same error on Win10/2008R2 when running the examples from the socks5-http-client project.

@mattcg
Copy link
Owner

mattcg commented Nov 9, 2015

This should have been fixed by #11. Will you re-test please?

@anderfjord
Copy link

Installing the latest version (1.1.2) has fixed my problem. Thanks!

@mattcg
Copy link
Owner

mattcg commented Nov 9, 2015

Fantastic, thank you for reporting! 💖

@mattcg mattcg closed this as completed Nov 9, 2015
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

3 participants