How to Use Socks5 Proxy With Google Chrome

Created On: 2016-12-22

Suppose you have a socks5 proxy running at localhost:8001. Here is the command to start chrome with that proxy:

google-chrome --proxy-bypass-list=localhost,10.0.0.0/8,127.0.0.0/8,192.168.0.0/16 --proxy-server=socks5://localhost:8001 &

Single Instance Detection and User Data Dir

If chrome is already running when you run this command, you need to quit it first. Since repeated invocations of google-chrome will reuse an existing process for a given user data directory.

If you want to keep the existing chrome running and start a new instance with this proxy settings, you can create a new user-data-dir:

mkdir -p $HOME/.config/chrome-with-proxy
google-chrome --user-data-dir=$HOME/.config/chrome-with-proxy --proxy-bypass-list=localhost,10.0.0.0/8,127.0.0.0/8,192.168.0.0/16 --proxy-server=socks5://localhost:8001 &

Create a Wrapper Script

If you always want to start chrome with proxy, you can create a wrapper script. Create ~/bin/chrome or /usr/local/bin/chrome with the following content:

#!/bin/sh
google-chrome --proxy-bypass-list=localhost,10.0.0.0/8,127.0.0.0/8,192.168.0.0/16 --proxy-server=socks5://localhost:8001 "$@" &

Then you can call chrome to start it. You can also put --user-data-dir there if you wish.

References

Is this post helpful?