Closed AvgAwsmDude closed 2 years ago
I think it should work if you configured properly.
You need to create tun on each container which is explained here how to : https://stackoverflow.com/questions/59451531/how-to-create-tun-interface-inside-docker-container-image and use tun2socks.
@chromer030 why isnt it possible with redsocks? like i force each containers ip:port to redsocks where i wouldve mapped it to use proxy?
@chromer030 im asking this because i found it easy to setup redsocks+iptables but i have no idea how to use tun2socks
https://stackoverflow.com/questions/72198113/running-docker-containers-each-with-socsk5-proxy this is what im trying to achieve
I think it should work if you configured properly.
but i want to use just one tun container not one for each other container im trying to proxy
Easy. Try to use a proxy’s proxy (that’s what I call 😂) and redirect the connections to target socks5 proxy by your rule.
And for that, you can use a tool called v2ray, it has some advanced routing mechanism for proxy.
damn, it all looks so complicated :'( , tell me ,
iptables -t nat -A REDSOCKS -p tcp --dport 80 -j REDIRECT --to-ports 12345
iptables -t nat -A REDSOCKS -p tcp --dport 443 -j REDIRECT --to-ports 12345
iptables -t nat -A REDSOCKS -p tcp --dport 11371 -j REDIRECT --to-ports 12345
when i do this , my app runs using the proxy, now if i want to use many instances of my app , how will i get my container ip and port or dport , so that i can map it all right? and provide the right config in redsocks.conf
base {
log_debug = off;
log_info = on;
log = "syslog:daemon";
daemon = on;
user = redsocks;
group = redsocks;
redirector = iptables;
}
redsocks {
local_ip = 127.0.0.1;
local_port = 12345;
ip = proxy-ip;
port = port;
type = socks5;
login = "user";
password = "pass";
}
what’s that… don’t make it complicated, iptables is not needed at all in your case.
what’s that… don’t make it complicated, iptables is not needed at all in your case.
Alright , to redirect the connections of the containers I need to figure out what ip:port the container is running on , how do I do that?
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days
Can i run multiple docker container and also run tun2socks docker container and config each of the other containers to a different socks5 proxy that i provide?