ncarlier / dockerfiles

My dockerfiles.
MIT License
52 stars 15 forks source link

how to use socks5 proxy #11

Open JeevansSP opened 2 years ago

JeevansSP commented 2 years ago

like the heading says, how do i use socks5 proxy , as it contains user and pass, where do i pass those here

docker run --privileged=true --net=host -d ncarlier/redsocks 1.2.3.4 3128

JeevansSP commented 2 years ago

@ncarlier

ncarlier commented 2 years ago

Hi, embedded configuration file is quite basic and don't set user/password. Your best option is to create your own redsocks.tmpl file and mount it:

docker run --privileged=true --net=host \
  -v whitelist.txt:/etc/redsocks-whitelist.txt \
  -v redsocks.tmpl:/etc/redsocks.tmpl \
  -d ncarlier/redsocks 1.2.3.4 3128
JeevansSP commented 2 years ago

suppose i have a k8s cluster , and im trying to deploy many pods , each pod will have two containers, this one and my app, i want the app to run through proxy , and then scale this up , each pod needs to have a seprate socks5 proxy (i will provide valid ones), is this possible?

AvgAwsmDude commented 2 years ago

@ncarlier

ncarlier commented 2 years ago

Mmmm I don't think so as this Docker image was built for standalone Docker use to use a global proxy for all containers running on the host. modify the host's network The entrypoint used iptable to modify the host's network. It may be a problem with the K8S network. Your needs seem to be simpler. Just create a genuine redsock image and configure your service to use this container as a proxy socks?

JeevansSP commented 2 years ago

@ncarlier okay got it, can i use your image , run it and then pass custom rules in redsocks.tmpl , where I map my other instances of my apps running on docker to diff proxies I provide?

JeevansSP commented 2 years ago

will that give all the the different docker containers their own proxies (which I provide)

JeevansSP commented 2 years ago

can i kindly contact you elsehwere ? twitter or gmail or something?