How to Access Internet with Chinese Server IP on Android (via Windows SSH Tunnel)
Background
When abroad, sometimes you need to access the internet with a Chinese IP address, such as accessing services that are only available to Chinese IPs. This article introduces a method to let Android phones use Chinese server IPs through SSH tunnels on Windows machines.
Prerequisites
- Chinese Server: You need a server located in China that supports SSH connections.
- Windows Computer: Acts as a relay station, running the SSH client.
- Android Phone: Needs to be on the same local network as the Windows computer.
Steps
1. Set up SSH Tunnel on Windows
Open Command Prompt (CMD) or PowerShell on the Windows computer, and enter the following command to create a SOCKS proxy through SSH tunnel:
ssh -i "C:\Users\xxx\.ssh\id_ed25519" -N -D 0.0.0.0:1080 user@your_domestic_server_ip
-i "C:\Users\xxx\.ssh\id_ed25519": Specify your private key path.-N: Indicates not to execute remote commands, only establish the tunnel.-D 0.0.0.0:1080: Specify dynamic port forwarding, listening on local port 1080.user@your_domestic_server_ip: Replace with your Chinese server’s username and IP address. Make sure the firewall allows traffic through port 1080.
2. Verify if SOCKS5 Proxy is Working
Install the Socks5 Configurator extension in Chrome browser, configure the proxy to 127.0.0.1:1080, and click SAVE. Close the browser and reopen it for the settings to take effect. Then visit https://ip.gs to check if the IP address is your server’s IP.
3. Convert SOCKS5 Proxy to HTTP Proxy
Privoxy is a tool that can convert SOCKS5 proxy to HTTP proxy. After downloading and installing Privoxy, edit its configuration file config.txt and add the following content:
listen-address 0.0.0.0:18118
forward-socks5 / 127.0.0.1:1080 .
Then restart the Privoxy service. It listens on port 8118 by default, but we change it to 18118 here to avoid conflicts.
4. Configure Android Phone to Use HTTP Proxy
On the Android phone, go to Wi-Fi settings, enter the settings of the currently connected network, change its proxy to “Manual”, enter the Windows computer’s LAN IP address and port 18118. You may need to reconnect the phone to the Wi-Fi.
Alternative Methods
If security requirements are not high, you can also use VPN services that route back to China, such as Kuaifan.