Open Ozguner opened 3 years ago
@Ozguner, can you show how you are instantiating the module with code?
@Ozguner, can you show how you are instantiating the module with code?
Hello @brozeph !
I set these IPs in listening part. My expectation was, outgoing connection would go from the IP we listen to. Basically I am looking for an option to specify outgoing IP. Is this possible with simple socks?
import socks5 from 'simple-socks';
const server = socks5.createServer();
server.listen(1080, '66.249.70.28', function () {
console.log('SOCKS5 proxy server started on 66.249.70.28:1080');
});
@Ozguner, can you show how you are instantiating the module with code?
Hello @brozeph !
I set these IPs in listening part. My expectation was, outgoing connection would go from the IP we listen to. Basically I am looking for an option to specify outgoing IP. Is this possible with simple socks?
import socks5 from 'simple-socks'; const server = socks5.createServer(); server.listen(1080, '66.249.70.28', function () { console.log('SOCKS5 proxy server started on 66.249.70.28:1080'); });
Although I am late to respond, this may be good for reference. I have a fork of simple-socks that can do what you're looking for. The API is very different (promises, different method names). It can be found here.
import { createProxyServer, waitForConnect } from '@e9x/simple-socks';
import { connect } from 'net';
const ip = '66.249.70.28';
const server = createProxyServer({
async connect(port, host) {
// create unconnected socket
const socket = connect({
port,
host,
localAddress: ip,
});
await waitForConnect(socket);
return socket;
},
});
server.listen(1080, ip, () => {
console.log('SOCKS5 proxy server started on %s:1080', ip);
});
There is also this lib if needed
https://github.com/lqqyt2423/node-socks5-server/blob/master/examples/1-normal.js
I have eth0 and eth0:1, eth0:2 total of 3 different IP's.
I have for example proxy server instances running on 10.0.0.1 and 10.0.0.2 and 10.0.0.3. However, regardless of which socks5 server IP I connect to from a client, I get assigned 10.0.0.1