mattcg / socks5-client

SOCKS v5 client socket implementation in JavaScript for Node.JS.
Other
56 stars 31 forks source link

Using with request with non standard port causes TypeError #17

Closed eostman closed 7 years ago

eostman commented 7 years ago

When trying to make a GET request to an url of type https://url.com:8075 via request.

var Agent = require('socks5-https-client/lib/Agent');

request({
  method: 'GET',
  url: "https://url.com:8075",
  agentClass: Agent,
 }

Then this error is thrown Failure with error: TypeError: Invalid port: 8075.

The failure seems to be caused because the port number is passed in as a String, request seems to pass the port number as a string instead of as an integer.

mattcg commented 7 years ago

Thank you for reporting this. Please try an npm update and let me know if it works after that :)

eostman commented 7 years ago

Yes, it works now. Thank you!