Blame view
node_modules/socks/examples/bind.js
615 Bytes
f7563de62
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
var Socks = require('../index.js'); var options = { proxy: { ipaddress: "202.101.228.108", port: 1080, type: 5, command: 'bind' }, target: { host: "0.0.0.0", port: 0 } }; Socks.createConnection(options, function(err, socket, info) { if (err) console.log(err); else { console.log("Connected"); // BIND request completed, now a tcp client should connect to this endpoint: console.log(info); // { port: 3334, host: '202.101.228.108' } // Resume! You need to! socket.resume(); } }); |