SOCKS5 Mode¶
SOCKS5 proxy mode is the recommended way to use R-VPN on desktop and mobile devices.
Overview¶
In SOCKS5 mode, R-VPN runs a local SOCKS5 proxy server. Applications connect to this local proxy, and their traffic is routed through the encrypted VPN tunnel to the R-VPN server.
┌──────────────┐ ┌─────────────┐ ┌─────────────┐
│ Application │────────►│ R-VPN Client│────────►│ R-VPN Server│
│ (Browser) │◄────────│ (SOCKS5) │◄────────│ │
└──────────────┘ └─────────────┘ └─────────────┘
127.0.0.1:1080 wss://vpn.example.com
Advantages¶
- No root required - Works without administrative privileges
- App-level - Only configured apps use the VPN
- Cross-platform - Works on any platform with SOCKS5 support
- Lightweight - Minimal system integration
Configuration¶
The SOCKS5 proxy is configured in the [socks5] section of client.toml:
# Server connection
server_address = "wss://vpn.example.com/connect"
identity_key_file = "identity.key"
prekey_bundle = "prekey-bundle.json"
[socks5]
listen_address = "127.0.0.1:1080"
udp_associate = true
Configuration Options¶
| Option | Default | Description |
|---|---|---|
listen_address |
127.0.0.1:1080 |
Address and port for the SOCKS5 proxy to listen on |
udp_associate |
true |
Enable UDP associate support for UDP traffic |
auth_enabled |
false |
Enable optional username/password authentication |
auth_username |
None |
Username for authentication (when auth_enabled is true) |
auth_password |
None |
Password for authentication (when auth_enabled is true) |
Starting SOCKS5 Proxy¶
# Using config file
rvpn --config client.toml
# Using command line
rvpn --server wss://vpn.example.com/connect \
--identity identity.key
Configuring Applications¶
Firefox¶
- Settings → Network Settings
- Select "Manual proxy configuration"
- SOCKS Host:
127.0.0.1 - Port:
1080 - Select "SOCKS5"
- Click OK
Chrome¶
Use an extension like SwitchyOmega or configure system proxy:
# macOS
export http_proxy=socks5://127.0.0.1:1080
export https_proxy=socks5://127.0.0.1:1080
# Linux
export http_proxy=socks5h://127.0.0.1:1080
export https_proxy=socks5h://127.0.0.1:1080
curl¶
iOS¶
Configure WiFi proxy settings:
- Server: 127.0.0.1 (requires a proxy app or jailbreak for local)
- Or use a SOCKS5-compatible app
Android¶
Use an app like "SocksDroid" or configure in supported apps.
Authentication¶
Enable optional authentication for the SOCKS5 proxy:
[socks5]
listen_address = "127.0.0.1:1080"
auth_enabled = true
auth_username = "myuser"
auth_password = "mypassword"
UDP Support¶
The SOCKS5 protocol supports UDP relay. Enable it in your apps:
Troubleshooting¶
Connection Refused¶
Ensure the client is running:
Authentication Failed¶
Verify credentials in configuration.
Slow Speed¶
Check your network connection and server load.
Next Steps¶
- Split Tunneling - Route local traffic outside VPN
- TUN Mode - Use full VPN mode
- Key Management - Manage identity keys