How to Set Up a Proxy in Shadowsocks
Shadowsocks is an open-source proxy tool that provides a secure means for browsing the web anonymously. It is primarily used to circumvent online censorship and improve privacy. Below is a step-by-step guide on how to configure a proxy in Shadowsocks, both on the server and the client.
- A server running Shadowsocks (can be on a VPS or dedicated server).
- Administrator access to the server to install Shadowsocks.
- A client device (such as a PC, mobile phone, or tablet) to configure the proxy.
To configure Shadowsocks on the server, follow these steps. Here we'll be using a Debian-based distribution (such as Ubuntu), but the process is similar for other Linux distributions.
1sudo apt update
2sudo apt upgrade
3
4
1sudo apt install python3-pip
2sudo pip3 install shadowsocks
3
4
3. Configure Shadowsocks: Create a configuration file for Shadowsocks in the /etc/shadowsocks/ directory:
1sudo mkdir /etc/shadowsocks
2sudo nano /etc/shadowsocks/config.json
3
4
The configuration file must have the following format:
1{
2"server": "0.0.0.0", // Server IP (can be the server IP) VPS)
3"server_port": 8388, // Server port
4"local_address": "127.0.0.1", // Local address
5"local_port": 1080, // Local port (can be any port)
6"password": "my_secure_password", // Password for the connection
7"timeout": 300,
8"method": "aes-256-cfb" // Encryption method
9}
10
11
Save and close the file.
1sudo ssserver -c /etc/shadowsocks/config.json
2
3
5. Configure the Firewall: Make sure the port configured in server_port (for example, 8388) is open in the firewall:
1sudo ufw allow 8388/tcp
2sudo ufw enable
3
4
Once the server is configured, you can configure the client on your device.
-
Download Shadowsocks for Windows: Visit the official Shadowsocks website at https://github.com/shadowsocks/shadowsocks-windows and download the latest stable version.
-
Install the Client: Run the downloaded installer and follow the instructions to complete the installation.
-
Configure the Client:
- Open the Shadowsocks client.
- Right-click the Shadowsocks icon in the system tray and select "Configure."
- Enter the server's IP address and the port Shadowsocks is listening on (by default, 8388).
- Enter the password you configured on the server.
- Select the same encryption method you configured on the server (for example, aes-256-cfb).
- Click "OK" to save the settings.
- Connect to the Server: After configuring the client, right-click the Shadowsocks icon and select "Connect." Your connection will now be protected through the Shadowsocks proxy.
-
Download the Shadowsocks App: You can download the official Shadowsocks app from the Google Play store.
-
Configure the App:
- Open the app and tap the "+" icon to add a new configuration.
- Enter your server details: IP address, port, password, and encryption method.
- Tap "Save" and then select "Connect".
-
Download the Shadowsocks App: The official Shadowsocks app is also available on the iOS App Store. Search for and install it.
-
Configure the App:
- Open the app and tap "Add Server".
- Enter the server's IP address, port, password, and encryption method.
- Tap "Save" and then connect to the server.
Once you've configured both the server and the client, it's important to verify that the connection is working properly. You can do this in the following ways:
-
Verify IP: You can visit a website like https://www.whatismyip.com to verify that your IP address has changed and is now being routed through the Shadowsocks server.
-
Check the Connection on the Client: On the Windows, Android, or iOS client, if you see a "Connected" indicator, then your proxy is working properly.
-
Configure a Local Proxy: If you want your web traffic to pass through the Shadowsocks proxy, configure your browser to use the local port you configured (by default, 1080). This can be done in your browser's proxy settings.
-
Automate Shadowsocks Startup: To have Shadowsocks start automatically on your server, you can configure it as a service in Linux using systemd. Create a service file and enable it to start with the system.
Shadowsocks is a powerful tool for protecting your online privacy and bypassing internet censorship. With these steps, you can easily set up a Shadowsocks proxy on your server and client device. Be sure to follow security best practices, such as using strong passwords and keeping your software up to date, to ensure your connection is secure and reliable.