0

Hi I want to proxy all chrome traffic through phone connected via usb with usb tethering enabled.

The name of the interface created after conneting the phone is enx6a4d9d721efe and it has ip 192.168.42.255.

What would be the easiest way to do such a thing?

2
  • You mean? You already have a PC (what OS?), which is already connected to the Internet! Now it is connected to the mobile network through USB!? Commented May 17, 2024 at 0:40
  • Install a proxy service and point the proxy's export to the USB ip. Set your Chrome proxy agent to this proxy server:port. Commented May 17, 2024 at 0:44

1 Answer 1

0

The usual solution to such problems is to launch the program you want to have a special network configuration for in a container, and set that up such that its networking does what you want.

For chrome that's simple, Jessie Frazelle is kind enough to maintain a repository of Docker containers. You can just go ahead and

git clone https://github.com/jessfraz/dockerfiles
cd dockerfiles/chromium
docker build -t jess/chromium

Then, you'd set up a docker network containing your tethering phone and start the container, as specified at the beginning of the chromium/Dockerfile used above (but replacing --net host appropriately).

Alternatively, you could run a SOCKS5 proxy tunnel to your phone, using SSH:
Install termux, install pkg install openssh in there, ssh-keygen -A to generate host keys on your phone in termux. Follow Termux' guide to enable public-key-based access (basically, just copy and paste your laptop's public key via echo "ssh-… " > .ssh/authorized_keys). Start sshd.

Connect to your phone's termux SSH server from your laptop using ssh -D 0.0.0.0:1080 your_phones_local_IP_address. Now, configure your chromium to use a SOCKS server, and use 127.0.0.1 (i.e., your laptop itself, which then tunnels through SSH to your phone), port 1080, by starting chromium with the command line:

chromium-browser  --proxy-server="socks5://127.0.0.1:1080" \
                  --host-resolver-rules"'MAP * ~NOTFOUND , EXCLUDE 127.0.0.1"
#^------+-------^
#       \------------------ or just "chromium", depending on your linux distro

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.