mscdex / socksv5

SOCKS protocol version 5 server and client implementations for node.js
MIT License
400 stars 121 forks source link

getting error while using socksv5 in my node js application #40

Open vinodpalne opened 5 years ago

vinodpalne commented 5 years ago

var socks = require('socksv5'), SSHClient = require('ssh2').Client;

const fixieUrl = "here is flexi url"; const fixieValues = fixieUrl.split(new RegExp('[/(:\/@)/]+'));

socks.connect({ host: 'ssh.example.org', port: 22, proxyHost: fixieValues[2], proxyPort: fixieValues[3], auths: [socks.auth.UserPassword(fixieValues[0], fixieValues[1])] }, function(socket) {

});

Throwing Error

TypeError: normalizeConnectArgs is not a function at Object.exports.connect.exports.createConnection (E:\NodeExample\AWSSSH2\AWSWithHeroku\node-js-getting-started\node_modules\socksv5\lib\client.js:225:14) at Object. (E:\NodeExample\AWSSSH2\AWSWithHeroku\node-js-getting-started\index.js:3:20) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) at Function.Module.runMain (module.js:693:10) at startup (bootstrap_node.js:191:16) at bootstrap_node.js:612:3

femanzo commented 5 years ago

I was having this issue because I followed @luminati-io/socksv5 package instructions, and installed this instead of @luminati-io/socksv5 if that is the case: npm rm socksv5 npm i @luminati-io/socksv5

nighthawkk commented 5 years ago

change 2nd line in /node_modules/socksv5/lib/client.js

normalizeConnectArgs = net._normalizeArgs,