From bb5046b6772c4c273285a7b4736d16c47e7a32ca Mon Sep 17 00:00:00 2001 From: Milad Rahimi Date: Fri, 31 May 2024 18:09:40 +0200 Subject: [PATCH 1/5] Update README.md --- README.md | 86 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 45 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index 580785b..d29abf4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # V2Ray Docker Compose -This repository contains V2Ray-based solutions for bypassing firewalls in highly restricted networks where direct access to upstream servers (servers with free internet access) is unavailable. +This repository contains V2Ray-based solutions for bypassing firewalls in restricted networks where direct access to upstream servers (servers with free internet access) is unavailable. ## Table of contents @@ -18,83 +18,87 @@ This repository contains V2Ray-based solutions for bypassing firewalls in highly ### V2Ray Upsream and Relay Servers -This solution is stable and supports Shadowsocks and VMess protocols by default. +The "V2Ray Upsream and Relay Servers" solution offers **high stability and speed** (depends on the network speeds of the relay and upstream servers). -You will need two types of servers: +The solution uses V2Ray on the upstream server, using the VMess protocol (over Websockets) for communication with the relay server. +The relay server provides **Shadowsocks** protocol for users, in addition to Socks5 and HTTP protocols for the relay server's own use. +You will need two types of servers: * **Upstream Server**: A server with access to the free internet, likely located in a foreign data center. * **Relay Server**: A server that can connect to the upstream server and is accessible to users, likely located in the same region as the users. +The flow of V2Ray Upsream and Relay Servers: + ``` -(Users) <-> [ Relay Server ] <-> [ Upstream Server ] <-> (Internet) +Users <-(Shadowsocks)-> Relay Server <-(VMess)-> Upstream Server <-> Internet ``` **Step 1: Setup Upstream Server** -1. Install Docker and Docker-compose. -1. Copy the `v2ray-upstream-server` and the `utils` directories into the upstream server. -1. Run ```./utils/bbr.sh``` to speed up server network. -1. Run ```cat /proc/sys/kernel/random/uuid``` in your terminal to generate a UUID. -1. Replace `` in `config.json` with the generated UUID. +1. Install Docker and Docker-compose ([Official Documanetation](https://docs.docker.com/engine/install/#supported-platforms)). +1. Run `git clone https://github.com/miladrahimi/v2ray-docker-compose.git` to download this repository. +1. Run `./utils/bbr.sh` to setup BBR in order to speed up server network. +1. Run `cd v2ray-upstream-server` to change the directory. +1. Run `cat /proc/sys/kernel/random/uuid` to generate a UUID. +1. Replace `` in `v2ray.json` with the generated UUID. 1. Run `docker-compose up -d`. **Step 2: Setup Relay Server** -1. Install Docker and Docker-compose. -1. Copy the `v2ray-relay-server` and the `utils` directories into the relay server. -1. Run ```./utils/bbr.sh``` to speed up server network. -1. Replace the following variables in `config.json` with appropriate values. +1. Install Docker and Docker-compose ([Official Documanetation](https://docs.docker.com/engine/install/#supported-platforms)). +1. Run `git clone https://github.com/miladrahimi/v2ray-docker-compose.git` to download this repository. +1. Run `./utils/bbr.sh` to setup BBR in order to speed up server network. +1. Run `cd v2ray-relay-server` to change the directory. +1. Replace the following variables in `v2ray.json` with appropriate values. * ``: A password for Shadowsocks users like `FR33DoM`. - * ``: A new UUID for relay server (Run ```cat /proc/sys/kernel/random/uuid```). * ``: The upstream server IP address (like `13.13.13.13`). * ``: The upstream server UUID from the previous step. 1. Run `docker-compose up -d`. 1. Run `./clients.py` to generate client configurations and links. -### V2Ray Behind a CDN Service +### V2Ray Behind CDN + +The "V2Ray Behind CDN" solution is recommended only if you don't have relay server to implement other solutions. -This solution is recommended only if you don't have relay server to implement other solutions. +This solution provides **VMess over Websockets + TLS + CDN** ([Read more](https://guide.v2fly.org/en_US/advanced/wss_and_web.html)) for users. -In this solution, you need one server (upstream) and a domain/subdomain added to a CDN service. +In this solution, you need upstream server and a domain added to a CDN service. +* **Upstream Server**: A server with access to the free internet, likely located in a foreign data center. +* **CDN Service**: A Content Delivery Network service like [Cloudflare](//cloudflare.com) and [ArvanCloud](//arvancloud.ir). -* Upstream Server: A server that has free access to the Internet. -* CDN Service: A Content delivery network like [Cloudflare](//cloudflare.com), [ArvanCloud](//arvancloud.ir) or [DerakCloud](//derak.cloud). +The flow of V2Ray Behind CDN: ``` -(Users) <-> [ CDN Service ] <-> [ Upstream Server ] <-> (Internet) +Users <-(VMess)-> CDN <-> Upstream Server <-> Internet ``` -This solution provides VMESS over Websockets + TLS + CDN. -[Read more...](https://guide.v2fly.org/en_US/advanced/wss_and_web.html) - -Follow these steps to set up V2Ray + Caddy (Web server) + CDN: +Follow these steps to set up V2Ray, Caddy (Web server) and CDN: -1. On your CDN, create an `A` record pointing to your server IP with the proxy option turned off. -1. Install Docker and Docker-compose on your server. -1. Copy the `v2ray-caddy-cdn` and the `utils` directories into the server. -1. Run ```./utils/bbr.sh``` to speed up server network. -1. Run ```cat /proc/sys/kernel/random/uuid``` to generate a UUID. -1. Replace `` in `config.json` with the generated UUID. +1. On the CDN panel, create an `A` record pointing to the server IP with the proxy option turned off. +1. Install Docker and Docker-compose ([Official Documanetation](https://docs.docker.com/engine/install/#supported-platforms)). +1. Run `git clone https://github.com/miladrahimi/v2ray-docker-compose.git` to download this repository. +1. Run `./utils/bbr.sh` to setup BBR in order to speed up server network. +1. Run `cd v2ray-caddy-cdn` to change the directory. +1. Run `cat /proc/sys/kernel/random/uuid` to generate a UUID. +1. Replace `` in `v2ray.json` with the generated UUID. 1. Replace `` in `caddy/Caddyfile` with your domain/subdomain. 1. Run `docker-compose up -d`. 1. Visit your domain/subdomain in your web browser. Wait until the [homepage](https://github.com/miladrahimi/v2ray-docker-compose/blob/master/v2ray-caddy-cdn/caddy/web/index.html) is loaded. -1. (Optional) In your CDN, turn the proxy option on for the record. +1. On the CDN panel, turn the proxy option on for the record created in the first step. 1. Run `./vmess.py` to generate client configuration (link). -If you prefer NGINX as the web server, read [V2RAY_NGINX_CDN](docs/V2RAY_NGINX_CDN.md) instead. - -Some CDN services don't offer unlimited traffic for free plans. -Please check [CDN Free Plans](https://github.com/miladrahimi/v2ray-docker-compose/discussions/89). - -You don't need to turn the cloud (proxy) on in your CDN (step 10) when the Internet is not blocked. -When it's off, clients connect to the server directly and CDN services also don't charge you any fee. +**Notes** +- If you prefer using NGINX as your web server, please refer to [V2RAY_NGINX_CDN](docs/V2RAY_NGINX_CDN.md). +- Some CDN services do not provide unlimited traffic with their free plans. + Please check [CDN Free Plans](https://github.com/miladrahimi/v2ray-docker-compose/discussions/89). +- You can skip step 10 and keep the proxy off, but this could lead to quicker server blocking. ### V2Ray as Relay for Outline This **highly recommended** solution is stable and easy to set up. -Using the Outline Manager app, you can create and manage multiple users and track their traffic. -It supports Shadowsocks protocol and offers the easy-to-use Outline client app. +Using the Outline Manager app, you can setup servers, create and manage users and track their traffic. +It supports **Shadowsocks** protocol and offers the user-friendly Outline client application. Read more: [Outline Bridge Server](https://github.com/miladrahimi/outline-bridge-server) @@ -113,7 +117,7 @@ This is the list of recommended applications to use the Shadowsocks protocol: ### VMess Protocol -This is the list of recommended applications to use the VMess and other protocols: +This is the list of recommended applications to use the VMess protocol: * [Nekoray](https://github.com/MatsuriDayo/nekoray/releases) for macOS, Windows, and Linux * [FoXray](https://foxray.org/#download) for macOS, iOS, and Android From 4e5eb0bf56e72808d4909abdf0c6cd5d7cd063f8 Mon Sep 17 00:00:00 2001 From: Milad Rahimi Date: Fri, 31 May 2024 18:23:50 +0200 Subject: [PATCH 2/5] Update README.md --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index d29abf4..2ba9b55 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This repository contains V2Ray-based solutions for bypassing firewalls in restri * [Server Solutions](#server-solutions) * [V2Ray Upsream and Relay Servers](#v2ray-upsream-and-relay-servers) - * [V2Ray Behind a CDN Service](#v2ray-behind-a-cdn-service) + * [V2Ray Behind CDN](#v2ray-behind-cdn) * [V2Ray as Relay for Outline](#v2ray-as-relay-for-outline) * [Client Applications](#client-applications) * [Shadowsocks Protocol](#shadowsocks-protocol) @@ -37,30 +37,30 @@ Users <-(Shadowsocks)-> Relay Server <-(VMess)-> Upstream Server <-> Internet 1. Install Docker and Docker-compose ([Official Documanetation](https://docs.docker.com/engine/install/#supported-platforms)). 1. Run `git clone https://github.com/miladrahimi/v2ray-docker-compose.git` to download this repository. -1. Run `./utils/bbr.sh` to setup BBR in order to speed up server network. -1. Run `cd v2ray-upstream-server` to change the directory. +1. Run `cd v2ray-docker-compose/v2ray-upstream-server` to change the directory. 1. Run `cat /proc/sys/kernel/random/uuid` to generate a UUID. 1. Replace `` in `v2ray.json` with the generated UUID. 1. Run `docker-compose up -d`. +1. (Optional) Run `./../utils/bbr.sh` to setup BBR and speed up the server network. **Step 2: Setup Relay Server** 1. Install Docker and Docker-compose ([Official Documanetation](https://docs.docker.com/engine/install/#supported-platforms)). 1. Run `git clone https://github.com/miladrahimi/v2ray-docker-compose.git` to download this repository. -1. Run `./utils/bbr.sh` to setup BBR in order to speed up server network. -1. Run `cd v2ray-relay-server` to change the directory. +1. Run `cd v2ray-docker-compose/v2ray-relay-server` to change the directory. 1. Replace the following variables in `v2ray.json` with appropriate values. * ``: A password for Shadowsocks users like `FR33DoM`. * ``: The upstream server IP address (like `13.13.13.13`). * ``: The upstream server UUID from the previous step. 1. Run `docker-compose up -d`. 1. Run `./clients.py` to generate client configurations and links. +1. (Optional) Run `./../utils/bbr.sh` to setup BBR and speed up the server network. ### V2Ray Behind CDN The "V2Ray Behind CDN" solution is recommended only if you don't have relay server to implement other solutions. -This solution provides **VMess over Websockets + TLS + CDN** ([Read more](https://guide.v2fly.org/en_US/advanced/wss_and_web.html)) for users. +This solution provides **VMess** over **Websockets + TLS + CDN** ([Read more](https://guide.v2fly.org/en_US/advanced/wss_and_web.html)) for users. In this solution, you need upstream server and a domain added to a CDN service. * **Upstream Server**: A server with access to the free internet, likely located in a foreign data center. @@ -74,19 +74,19 @@ Users <-(VMess)-> CDN <-> Upstream Server <-> Internet Follow these steps to set up V2Ray, Caddy (Web server) and CDN: -1. On the CDN panel, create an `A` record pointing to the server IP with the proxy option turned off. +1. In the CDN panel, create an `A` record for the server IP with the proxy disabled. 1. Install Docker and Docker-compose ([Official Documanetation](https://docs.docker.com/engine/install/#supported-platforms)). 1. Run `git clone https://github.com/miladrahimi/v2ray-docker-compose.git` to download this repository. -1. Run `./utils/bbr.sh` to setup BBR in order to speed up server network. -1. Run `cd v2ray-caddy-cdn` to change the directory. +1. Run `cd v2ray-docker-compose/v2ray-caddy-cdn` to change the directory. 1. Run `cat /proc/sys/kernel/random/uuid` to generate a UUID. 1. Replace `` in `v2ray.json` with the generated UUID. 1. Replace `` in `caddy/Caddyfile` with your domain/subdomain. 1. Run `docker-compose up -d`. 1. Visit your domain/subdomain in your web browser. Wait until the [homepage](https://github.com/miladrahimi/v2ray-docker-compose/blob/master/v2ray-caddy-cdn/caddy/web/index.html) is loaded. -1. On the CDN panel, turn the proxy option on for the record created in the first step. -1. Run `./vmess.py` to generate client configuration (link). +1. In the CDN panel, enable the proxy option for the record created during the first step. +1. Run `./vmess.py` to generate client configuration link. +1. (Optional) Run `./../utils/bbr.sh` to setup BBR and speed up the server network. **Notes** - If you prefer using NGINX as your web server, please refer to [V2RAY_NGINX_CDN](docs/V2RAY_NGINX_CDN.md). From 356cb6803ca76f66bd0a3ab637af05ce0ef58034 Mon Sep 17 00:00:00 2001 From: Milad Rahimi Date: Fri, 31 May 2024 18:25:00 +0200 Subject: [PATCH 3/5] Update HTTP_SOCKS.md --- docs/HTTP_SOCKS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/HTTP_SOCKS.md b/docs/HTTP_SOCKS.md index 071f7e2..f089f5f 100644 --- a/docs/HTTP_SOCKS.md +++ b/docs/HTTP_SOCKS.md @@ -1,7 +1,7 @@ # HTTP & SOCKS Protocols The HTTP and SOCKS (SOCKS5) proxy protocols are appropriate for internal usage on the relay server and port forwarding. -They would be exposed to the 127.0.0.1 IP address without passwords. +They would be exposed to the `127.0.0.1` IP address without passwords. ## On the relay server From ca15d0c81eacb715c13df0f623fa524e55989dee Mon Sep 17 00:00:00 2001 From: Milad Rahimi Date: Fri, 31 May 2024 18:25:28 +0200 Subject: [PATCH 4/5] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2ba9b55..b194ed8 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ This repository contains V2Ray-based solutions for bypassing firewalls in restri * [Shadowsocks Protocol](#shadowsocks-protocol) * [VMess Protocol](#vmess-protocol) * [HTTP and SOCKS Protocols](#http-and-socks-protocols) - * [More](#more) + * [Links](#links) ## Server Solutions @@ -131,7 +131,7 @@ This is the list of recommended applications to use the VMess protocol: Moved here: [HTTP_SOCKS](docs/HTTP_SOCKS.md) -## More +## Links * [Outline Bridge Server](https://github.com/miladrahimi/outline-bridge-server) * [V2Ray Config Examples](https://github.com/xesina/v2ray-config-examples) From 04d581c15489651538c15148847f95e6628f2567 Mon Sep 17 00:00:00 2001 From: Milad Rahimi Date: Fri, 31 May 2024 18:34:01 +0200 Subject: [PATCH 5/5] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b194ed8..4db5e78 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Users <-(Shadowsocks)-> Relay Server <-(VMess)-> Upstream Server <-> Internet 1. Run `cd v2ray-docker-compose/v2ray-upstream-server` to change the directory. 1. Run `cat /proc/sys/kernel/random/uuid` to generate a UUID. 1. Replace `` in `v2ray.json` with the generated UUID. -1. Run `docker-compose up -d`. +1. Run `docker compose up -d`. 1. (Optional) Run `./../utils/bbr.sh` to setup BBR and speed up the server network. **Step 2: Setup Relay Server** @@ -52,7 +52,7 @@ Users <-(Shadowsocks)-> Relay Server <-(VMess)-> Upstream Server <-> Internet * ``: A password for Shadowsocks users like `FR33DoM`. * ``: The upstream server IP address (like `13.13.13.13`). * ``: The upstream server UUID from the previous step. -1. Run `docker-compose up -d`. +1. Run `docker compose up -d`. 1. Run `./clients.py` to generate client configurations and links. 1. (Optional) Run `./../utils/bbr.sh` to setup BBR and speed up the server network. @@ -81,7 +81,7 @@ Follow these steps to set up V2Ray, Caddy (Web server) and CDN: 1. Run `cat /proc/sys/kernel/random/uuid` to generate a UUID. 1. Replace `` in `v2ray.json` with the generated UUID. 1. Replace `` in `caddy/Caddyfile` with your domain/subdomain. -1. Run `docker-compose up -d`. +1. Run `docker compose up -d`. 1. Visit your domain/subdomain in your web browser. Wait until the [homepage](https://github.com/miladrahimi/v2ray-docker-compose/blob/master/v2ray-caddy-cdn/caddy/web/index.html) is loaded. 1. In the CDN panel, enable the proxy option for the record created during the first step.