This tutorial explains the workaround to force Steam to use the phone's proxy service to access the internet.
https://hackmd.io/@brlin/steam-over-proxy-howto
I'm avoiding my ISP throttling my internet access too much according my network usage of network tethering by using the TetherFi application to run an HTTP/HTTPS proxy service on the phone and configure the computer to access the internet over it. However, in this case Steam online functionalities such as cloud save syncing and game download/update will not work hence the need to find a workaround.
Note:
The major part of Steam(except of minor features such as crash dump uploading) doesn't honour the http_proxy
and https_proxy
environment variables.
By running an SSH service capable of application-level port forwarding on the phone I can setup a SOCKS proxy service using the SSH client at the localhost and force all outgoing TCP network packets to go through the SOCKS proxy service via the use of the Redsocks service.
According to the 3.A section of the STEAM® Subscriber Agreement:
You agree that you will not use IP proxying or other methods to disguise the place of your residence, whether to circumvent geographical restrictions on game content, to order or purchase at pricing not applicable to your geography, or for any other purpose. If you do this, Valve may terminate your access to your Account.
This may raise concerns of whether using the proxy may violate the agreement, fortunately, for this use case the proxy service is at the same geographic location as the proxy client, thus does not fall under the the terms of this section.
This section documets the prerequisites of doing this tutorial:
Any regular GNU+Linux distribution should do.
This section documents the process of setting the solution up:
A Git repository has been prepared for the following operations, please clone the repository or download & extract the code to your local host.
https://gitlab.com/brlin/ProxifierLinux
Launch the TetherFi application and start the service.
Configure the network of your computer to connect to the TetherFi hotspot.
Follow the following operation instructions to setup the SimpleSSHD SSH service on the phone:
Install the SimpleSSHD application via the F-droid application store application.
Launch the application.
Start the service.
Log into the remote shell using an SSH client and the password specified in the SimpleSSHD application's service log view.
Create the authorized_keys
file with the content of your SSH public key in the remote user's home directory.
Note:
~/.ssh/authorized_keys
path for the authorized_keys file, you should create it under the remote user's home directory.vi
editor to create and edit the file, or use SCP/SFTP to upload it from local.authorized_keys
file should contain the complete SSH public key, not its fingerprint.Log out and re-login to verify whether the key authentication works.
Now we can configure our SSH client to connect to the SimpleSSHD server, and set up a SOCKS server at the localhost to serve TCP/UDP network requests that would route through the SSH connection and sent out as if it is sent by the mobile device itself.
Merge the following OpenSSH client configuration into the ~/.ssh/config file:
You can now start the SSH SOCKS service by running the following command in a terminal:
Note:
You can disable the SOCKS service by running the following command in a terminal:
Run the following command in a terminal to start the SSHD service:
Refer the shell script file's header to find environment variables that needs to be customized according to your configuration.
If the command runs successful there should be a SOCKS service listening locally at the 1080 port that will route all connections through the mobile device.
Note:
You can disable the SOCKS service by running the following command in a terminal:
You may verify whether the SOCKS service is running by running the following command in a terminal:
It should output something simlar to this one:
Install redsocks software via your distribution's package manager or from the source code.
Refer to the /path/to/ProxifierLinux/redsocks.conf.sample for a sample configuration file for configuring redsocks.
Start the redsocks service by running the following command as root if you're using a systemd-managed redsocks installation:
If you build redsocks from source, run the following command in the terminal instead:
Run the following command in a terminal as root to set up the iptables firewall rules to redirect all outgoing and incoming packets to the redsocks service:
You may reset the firewall rules by running the following command in a terminal as root:
You can test whether the proxifier works by running the following command:
It should have an output similar to the following one:
At the moment, the name resolution will not work as TetherFi doesn't support DNS service:
we will solve this problem by using the goproxy software to emulate a DNS service at the localhost to redirect all DNS requests to the SSH SOCKS service.
Warning: The developer of the goproxy software may be under the influence of the Chinese autocracy government. Use the software with caution.
Download and extract the pre-built archive or build the software from source.
Launch a terminal application
Run the following command as root to start the DNS emulation service:
Configure your network to use the 127.0.0.1 custom DNS server instead of the supplied defunct 192.168.49.1 one. This time the curl --location https://1.1.1.1
command should work.
The following section documents ways to troubleshoot setup problems.
Like this log entry:
Try restarting the systemd-resolved service, the service may mark the DNS server as down thus blocking all resolve requests.
Try running the following two commands in the text terminal:
The following third-party materials are referenced during the development of this solution:
-d
command-line option of the iptables
command.