This repository contains sample Docker Compose files to run upstream and bridge V2Ray servers.
- Upstream Server: A server that has free access to the Internet.
- Bridge Server: A server that is available to clients and has access to an upstream server.
- Client: A user-side application with access to the bridge server.
[ Client ] <-> [ Bridge Server ] <-> [ Upstream Server ] <-> [ Internet ]
V2Ray uses the VMESS protocol as the primary protocol. The VMESS protocol requires UUIDs for security reasons (instead of passwords). We need two UUIDs for the two V2Ray servers (upstream and bridge servers).
You can generate UUIDs:
1- Online:
2- The Linux command:
cat /proc/sys/kernel/random/uuid
Sample UUIDs:
cfc3ac34-a70d-424e-b43c-33049cf4bf31
143d98d8-ac89-465a-acb5-d8d51e1f851f
To setup the upstream server:
- Copy the "v2ray_upstream_server" directory into the upstream server.
- Replace
<UPSTREAM-UUID>
in theconfig.json
file with the generated UUID for the upstream server. - Run
docker-compose up -d
.
To setup the bridge server:
- Copy the "v2ray_bridge_server" directory into bridge server.
- Replace the following variables in the
config.json
file with appropriate values.<SHADOWSOCKS-PASSWORD>
: A password for ShadowSocks like!FR33DoM!
.<BRIDGE-UUID>
: The generated UUID for the bridge server.<UPSTREAM-SERVER-IP>
: The upstream server IP address like13.13.13.13
.<UPSTREAM-UUID>
: The generated UUID for the upstream server.
- Run
docker-compose up -d
.
The bridge server exposes these proxy protocols:
- HTTP
- ShadowSocks
- VMESS
ShadowSocks is a popular proxy protocol. You can find many client apps to use the ShadowSocks proxy on your devices. These are recommended client apps:
- ShadowSocks for macOS
- ShadowSocks for Linux
- ShadowSocks for Windows
- ShadowSocks for Android
- ShadowLink for iOS
- Potatso Lite for iOS
Client configuration:
IP: <BRIDGE-SERVER-IP>
Port: 1012
Encryption (Algorithm): aes-128-gcm
Password: <SHADOWSOCKS-PASSWORD>
The VMESS proxy protocol is the recommended one. It's the primary protocol that V2Ray provides. These are recommended client apps:
Client configuration:
IP: <BRIDGE-SERVER-IP>
Port: 1013
User ID: <BRIDGE-UUID>
Alter ID: 10
Level: 0
Security (Encryption): aes-128-gcm
Network: TCP
The HTTP proxy is for internal usage on the bridge server and would be exposed only to the 127.0.0.1 IP address without password. For example, the command below shows how to use it on the bridge server terminal. The cURL response should be the upstream server IP address.
export http_proxy=http://127.0.0.1:1011;export https_proxy=http://127.0.0.1:1011;
curl ifconfig.io
You can use the HTTP proxy on your local device using port forwarding, as well. The following command makes the HTTP proxy on the bridge server available to the local device and private network it uses.
ssh -NL 1011:0.0.0.0:1011 root@<BRIDGE-SERVER-IP>
This repository is kind of forked from v2ray-config-examples. Thanks to @xesina and other contributors.