Skip to content

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

  1. Settings → Network Settings
  2. Select "Manual proxy configuration"
  3. SOCKS Host: 127.0.0.1
  4. Port: 1080
  5. Select "SOCKS5"
  6. 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

curl --socks5 127.0.0.1:1080 https://example.com

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:

[socks5]
udp_associate = true

Troubleshooting

Connection Refused

Ensure the client is running:

netstat -an | grep 1080

Authentication Failed

Verify credentials in configuration.

Slow Speed

Check your network connection and server load.

Next Steps