Intial Commit
This commit is contained in:
24
nodered/rootfs/data/node_modules/socks5-client/index.js
generated
vendored
Normal file
24
nodered/rootfs/data/node_modules/socks5-client/index.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/*jshint node:true*/
|
||||
'use strict';
|
||||
|
||||
var Socket = require('./lib/Socket');
|
||||
|
||||
exports.Socket = Socket;
|
||||
|
||||
exports.createConnection = function(options) {
|
||||
var host, hostname = options.hostname, port = options.port;
|
||||
|
||||
if (options.host && (!hostname || !port)) {
|
||||
host = options.host.split(':');
|
||||
}
|
||||
|
||||
if (!port && host) {
|
||||
port = parseInt(host[1], 10) || 0;
|
||||
}
|
||||
|
||||
if (!hostname && host) {
|
||||
hostname = host[0];
|
||||
}
|
||||
|
||||
return new Socket(options).connect(port, hostname);
|
||||
};
|
||||
Reference in New Issue
Block a user