What Is Shadowsocks?
Shadowsocks is an encrypted network tunnel that allows applications to access the internet through a SOCKS proxy running on the same device. In some ways, it can be used like a VPN, since clients support transparent redirection of application traffic into the tunnel.
Originally, Shadowsocks was developed as a tool to bypass internet censorship in China. Over time, it gained support for external plugin modules, allowing Shadowsocks traffic to be wrapped in various types of network connections. This greatly expanded its use cases.
This guide describes how to deploy a Shadowsocks server with the v2ray plugin on the cloud provider Heroku. Heroku allows you to deploy small web applications for free, and the v2ray plugin enables Shadowsocks traffic to be tunneled inside a websocket connection, making it possible to run the whole setup on Heroku.
Deploying the Server
This guide uses a ready-made Heroku app project that automates all necessary steps. Here is the link to my fork of this project.
Step 1. Register on Heroku
Go to the Heroku website, click “Sign up,” and fill in the required information. You only need an email address to register.
Step 2. Start Deployment
Click on this link to begin deployment.
Step 3. Configuration
In the form that appears, fill in all fields as shown in the screenshot:
- For “App Name” and “AppName,” enter a unique name for your app (the same in both fields). This name will become part of the domain <appname>.herokuapp.com, which will be the address of your service.
- Set your own password in the PASSWORD field. You can make it long and secure—you likely won’t need to enter it manually.
- It’s also recommended to change the QR path to something hard to guess.
Step 4. Launch
After filling out the form, click “Deploy app.”
Once the build and launch are complete, a QR code with the configuration for mobile devices will be available at:
https://APPNAME.herokuapp.com/qr/vpn.png
The configuration string as a URL will be available at:
https://APPNAME.herokuapp.com/qr/
Replace APPNAME with the app name you chose. If you changed the QR code path, the link will change accordingly. Note: the trailing slash in the second link is required.
That’s it, you’re ready to use your server!
Setting Up the Mobile Client (Android Example)
- Install the Shadowsocks client and the v2ray plugin on your device.
- Open the app and add a new profile by tapping the plus button in the top right corner.
- Select “Scan QR code” and scan the code.
- Select the created profile by tapping it.
- Start the connection by pressing the round button at the bottom.
Done!
Setting Up the Desktop Client (Windows Example)
- Download and extract Shadowsocks.
- Download the v2ray plugin suitable for your platform. Extract the file and rename it to
v2ray.exe
(or justv2ray
if your file explorer hides extensions). Place it in the same directory as Shadowsocks. - Launch Shadowsocks.
- Copy the configuration URL for your personal Shadowsocks server from
https://APPNAME.herokuapp.com/qr/
, where APPNAME is your chosen app name. - Right-click the Shadowsocks icon in the system tray and select “Servers → Import URL from Clipboard.”
- Enable the proxy by selecting “System Proxy → Global” in the same context menu.
Done!
Note: If your browser has extensions that manage proxy settings (like VPN extensions or Switchy Omega), enabling Shadowsocks via “System Proxy → Global” will not affect the browser. You’ll need to either disable those extensions or configure them to use the system proxy if possible.
Heroku Limitations
Currently, Heroku apps have the following limitations:
- The free usage tier allows for 550 hours of app runtime per month.
- The app container goes to sleep after 30 minutes of inactivity. This can cause response delays of up to 30 seconds after a period of inactivity, but it also helps conserve your monthly quota.
- The monthly data transfer quota is 2 TB, which means you get just under 1 TB of proxy traffic per month.
Author: Baykal