Просмотр исходного кода

Update protocol paths to root-friendly routes and adjust configs/README accordingly
- Change VLESS WebSocket path from /vless-ws to root (/) to support root-based routing and CDN-friendly setups.
- Change VLESS gRPC service name from vless-grpc to grpc for simpler, shorter service identifiers.
- Change VMess WebSocket path from /vmess-ws to /ws for consistency and shorter paths.
- Propagate these defaults across environment examples, install scripts, service templates, generated configs, and container entrypoints:
- Updated .env.example, easy-install.sh, generate-config.sh, services/v2ray/config.template.json, v2ray/config/config.template.json, services/v2ray/entrypoint.sh, v2ray/config/config.template.json.
- Update documentation and client examples in README.md to reflect new paths/service names and update shareable URIs and JSON/ws/grpc snippets accordingly.
- Update Nginx vhost and debug location configs (vhost/default, debug-location.conf) to route:
- VLESS WS -> location / (root)
- VLESS gRPC -> location /grpc
- VMess WS -> location /ws
- Minor cleanup: remove obsolete fallback 404 block in debug-location.conf that conflicted with root routing; adjust comments to indicate root path usage and intent.

Sam 6 месяцев назад
Родитель
Сommit
64e61c4a9f

+ 3 - 3
.env.example

@@ -30,9 +30,9 @@ VMESS_WS_PORT=1312
 # ============================================
 # PROTOCOL PATHS
 # ============================================
-VLESS_WS_PATH=/vless-ws
-VLESS_GRPC_SERVICE=vless-grpc
-VMESS_WS_PATH=/vmess-ws
+VLESS_WS_PATH=/
+VLESS_GRPC_SERVICE=grpc
+VMESS_WS_PATH=/ws
 
 # ============================================
 # PROTOCOL ENABLEMENT (true/false)

+ 14 - 14
README.md

@@ -42,19 +42,19 @@ The modular setup supports **three Cloudflare-compatible protocols**:
 
 ### **🥇 VLESS + WebSocket + TLS (Best for CDN)**
 - **Port:** 1310
-- **Path:** `/vless-ws` 
+- **Path:** `/` 
 - **Performance:** ⭐⭐⭐⭐⭐
 - **CDN Compatible:** ✅ Excellent
 
 ### **🥈 VLESS + gRPC + TLS**
 - **Port:** 1311
-- **Service:** `vless-grpc`
+- **Service:** `grpc`
 - **Performance:** ⭐⭐⭐⭐
 - **CDN Compatible:** ✅ Good
 
 ### **🥉 VMess + WebSocket + TLS**
 - **Port:** 1312
-- **Path:** `/vmess-ws`
+- **Path:** `/ws`
 - **Performance:** ⭐⭐⭐
 - **CDN Compatible:** ✅ Good (Legacy)
 
@@ -125,7 +125,7 @@ vless://[email protected]:443?type=ws&security=tls&path=%2Fvless-ws&host
 
 #### **VLESS gRPC:**
 ```
-vless://[email protected]:443?type=grpc&security=tls&serviceName=vless-grpc&host=your-domain.com#VLESS-gRPC
+vless://[email protected]:443?type=grpc&security=tls&serviceName=grpc&host=your-domain.com#VLESS-gRPC
 ```
 
 #### **VMess WebSocket:**
@@ -226,9 +226,9 @@ VLESS_GRPC_PORT=1311    # VLESS gRPC
 VMESS_WS_PORT=1312      # VMess WebSocket
 
 # Protocol paths
-VLESS_WS_PATH=/vless-ws
-VLESS_GRPC_SERVICE=vless-grpc
-VMESS_WS_PATH=/vmess-ws
+VLESS_WS_PATH=/
+VLESS_GRPC_SERVICE=grpc
+VMESS_WS_PATH=/ws
 ```
 
 After editing `.env`, regenerate V2Ray config:
@@ -379,7 +379,7 @@ docker compose -f docker-compose.modular.yml exec v2ray cat /etc/v2ray/config.js
 - **Port:** 443
 - **UUID:** your-generated-uuid
 - **Network:** ws
-- **Path:** /vless-ws
+- **Path:** /
 - **TLS:** true
 
 #### **V2Ray Client JSON:**
@@ -401,7 +401,7 @@ docker compose -f docker-compose.modular.yml exec v2ray cat /etc/v2ray/config.js
       "network": "ws",
       "security": "tls",
       "wsSettings": {
-        "path": "/vless-ws",
+        "path": "/",
         "headers": {
           "Host": "your-domain.com"
         }
@@ -425,7 +425,7 @@ proxies:
     network: ws
     tls: true
     ws-opts:
-      path: /vless-ws
+      path: /
       headers:
         Host: your-domain.com
 ```
@@ -437,7 +437,7 @@ proxies:
 - **Port:** 443
 - **UUID:** your-generated-uuid
 - **Network:** grpc
-- **Service:** vless-grpc
+- **Service:** grpc
 - **TLS:** true
 
 #### **V2Ray Client JSON:**
@@ -459,7 +459,7 @@ proxies:
       "network": "grpc",
       "security": "tls",
       "grpcSettings": {
-        "serviceName": "vless-grpc"
+        "serviceName": "grpc"
       },
       "tlsSettings": {
         "serverName": "your-domain.com"
@@ -477,7 +477,7 @@ proxies:
 - **UUID:** your-generated-uuid
 - **AlterID:** 0
 - **Network:** ws
-- **Path:** /vmess-ws
+- **Path:** /ws
 - **TLS:** true
 
 #### **V2Ray Client JSON:**
@@ -500,7 +500,7 @@ proxies:
       "network": "ws",
       "security": "tls",
       "wsSettings": {
-        "path": "/vmess-ws",
+        "path": "/ws",
         "headers": {
           "Host": "your-domain.com"
         }

+ 5 - 10
debug-location.conf

@@ -6,9 +6,9 @@
 # ============================================
 
 # ============================================
-# VLESS WebSocket (Port 1310)
+# VLESS WebSocket (Port 1310) - Root Path /
 # ============================================
-location /vless-ws {
+location / {
     proxy_redirect off;
     proxy_pass http://v2ray:1310;
     proxy_http_version 1.1;
@@ -34,7 +34,7 @@ location /vless-ws {
 # ============================================
 # VLESS gRPC (Port 1311)
 # ============================================
-location /vless-grpc {
+location /grpc {
     # Handle CORS preflight requests
     if ($request_method = 'OPTIONS') {
         return 200;
@@ -56,7 +56,7 @@ location /vless-grpc {
 # ============================================
 # VMess WebSocket (Port 1312)
 # ============================================
-location /vmess-ws {
+location /ws {
     proxy_redirect off;
     proxy_pass http://v2ray:1312;
     proxy_http_version 1.1;
@@ -77,11 +77,6 @@ location /vmess-ws {
     
     # Disable buffering for real-time streaming
     proxy_buffering off;
-}
-
-# ============================================
-# Fallback - Return 404 for unmatched paths
-# ============================================
-location / {
+} {
     return 404;
 }

+ 9 - 9
easy-install.sh

@@ -284,9 +284,9 @@ VLESS_GRPC_PORT=1311
 VMESS_WS_PORT=1312
 
 # Protocol Paths
-VLESS_WS_PATH=/vless-ws
-VLESS_GRPC_SERVICE=vless-grpc
-VMESS_WS_PATH=/vmess-ws
+VLESS_WS_PATH=/
+VLESS_GRPC_SERVICE=grpc
+VMESS_WS_PATH=/ws
 
 # Protocol Enablement
 VLESS_WS_ENABLED=true
@@ -357,11 +357,11 @@ generate_v2ray_config() {
     # Set defaults if not in .env
     export V2RAY_UUID="${uuid}"
     export VLESS_WS_PORT="${VLESS_WS_PORT:-1310}"
-    export VLESS_WS_PATH="${VLESS_WS_PATH:-/vless-ws}"
+    export VLESS_WS_PATH="${VLESS_WS_PATH:-/}"
     export VLESS_GRPC_PORT="${VLESS_GRPC_PORT:-1311}"
-    export VLESS_GRPC_SERVICE="${VLESS_GRPC_SERVICE:-vless-grpc}"
+    export VLESS_GRPC_SERVICE="${VLESS_GRPC_SERVICE:-grpc}"
     export VMESS_WS_PORT="${VMESS_WS_PORT:-1312}"
-    export VMESS_WS_PATH="${VMESS_WS_PATH:-/vmess-ws}"
+    export VMESS_WS_PATH="${VMESS_WS_PATH:-/ws}"
     
     # Use template if available
     if [ -f "./v2ray/config/config.template.json" ]; then
@@ -589,17 +589,17 @@ if [ "$SETUP_CHOICE" = "2" ]; then
     echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
     echo "📱 VLESS WebSocket (Recommended):"
     echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
-    echo "vless://${UUID}@${CF_IP}:443?type=ws&security=tls&path=%2Fvless-ws&host=${DOMAIN}&sni=${DOMAIN}#${SERVER_INFO// /-}-VLESS-WS"
+    echo "vless://${UUID}@${CF_IP}:443?type=ws&security=tls&path=%2F&host=${DOMAIN}&sni=${DOMAIN}#${SERVER_INFO// /-}-VLESS-WS"
     echo ""
     echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
     echo "📱 VLESS gRPC:"
     echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
-    echo "vless://${UUID}@${CF_IP}:443?type=grpc&security=tls&serviceName=vless-grpc&host=${DOMAIN}&sni=${DOMAIN}#${SERVER_INFO// /-}-VLESS-gRPC"
+    echo "vless://${UUID}@${CF_IP}:443?type=grpc&security=tls&serviceName=grpc&host=${DOMAIN}&sni=${DOMAIN}#${SERVER_INFO// /-}-VLESS-gRPC"
     echo ""
     echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
     echo "📱 VMess WebSocket:"
     echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
-    VMESS_CONFIG=$(echo -n "{\"v\":\"2\",\"ps\":\"${SERVER_INFO// /-}-VMess-WS\",\"add\":\"${CF_IP}\",\"port\":\"443\",\"type\":\"none\",\"id\":\"${UUID}\",\"aid\":\"0\",\"net\":\"ws\",\"path\":\"/vmess-ws\",\"host\":\"${DOMAIN}\",\"tls\":\"tls\",\"sni\":\"${DOMAIN}\"}" | base64 -w 0 2>/dev/null || base64)
+    VMESS_CONFIG=$(echo -n "{\"v\":\"2\",\"ps\":\"${SERVER_INFO// /-}-VMess-WS\",\"add\":\"${CF_IP}\",\"port\":\"443\",\"type\":\"none\",\"id\":\"${UUID}\",\"aid\":\"0\",\"net\":\"ws\",\"path\":\"/ws\",\"host\":\"${DOMAIN}\",\"tls\":\"tls\",\"sni\":\"${DOMAIN}\"}" | base64 -w 0 2>/dev/null || base64)
     echo "vmess://${VMESS_CONFIG}"
     echo ""
     echo "=============================================="

+ 3 - 3
generate-config.sh

@@ -44,9 +44,9 @@ fi
 
 log_info "Generating V2Ray configuration..."
 log_info "  UUID: ${V2RAY_UUID:0:8}..."
-log_info "  VLESS WS: Port 1310, Path /vless-ws"
-log_info "  VLESS gRPC: Port 1311, Service vless-grpc"
-log_info "  VMess WS: Port 1312, Path /vmess-ws"
+log_info "  VLESS WS: Port 1310, Path /"
+log_info "  VLESS gRPC: Port 1311, Service grpc"
+log_info "  VMess WS: Port 1312, Path /ws"
 
 # Ensure directories exist
 mkdir -p v2ray/config

+ 3 - 3
services/v2ray/config.template.json

@@ -22,7 +22,7 @@
         "network": "ws",
         "security": "none",
         "wsSettings": {
-          "path": "/vless-ws"
+          "path": "/"
         }
       },
       "tag": "vless-ws"
@@ -44,7 +44,7 @@
         "network": "grpc",
         "security": "none",
         "grpcSettings": {
-          "serviceName": "vless-grpc"
+          "serviceName": "grpc"
         }
       },
       "tag": "vless-grpc"
@@ -66,7 +66,7 @@
         "network": "ws",
         "security": "none",
         "wsSettings": {
-          "path": "/vmess-ws"
+          "path": "/ws"
         }
       },
       "tag": "vmess-ws"

+ 3 - 3
services/v2ray/entrypoint.sh

@@ -17,11 +17,11 @@ fi
 # Set default values if not provided
 export V2RAY_UUID=${V2RAY_UUID:-"$(cat /proc/sys/kernel/random/uuid)"}
 export VLESS_WS_PORT=${VLESS_WS_PORT:-1310}
-export VLESS_WS_PATH=${VLESS_WS_PATH:-"/vless-ws"}
+export VLESS_WS_PATH=${VLESS_WS_PATH:-"/"}
 export VLESS_GRPC_PORT=${VLESS_GRPC_PORT:-1311}
-export VLESS_GRPC_SERVICE=${VLESS_GRPC_SERVICE:-"vless-grpc"}
+export VLESS_GRPC_SERVICE=${VLESS_GRPC_SERVICE:-"grpc"}
 export VMESS_WS_PORT=${VMESS_WS_PORT:-1312}
-export VMESS_WS_PATH=${VMESS_WS_PATH:-"/vmess-ws"}
+export VMESS_WS_PATH=${VMESS_WS_PATH:-"/ws"}
 
 echo "📋 Configuration Summary:"
 echo "   UUID: $V2RAY_UUID"

+ 3 - 3
v2ray/config/config.template.json

@@ -22,7 +22,7 @@
         "network": "ws",
         "security": "none",
         "wsSettings": {
-          "path": "/vless-ws"
+          "path": "/"
         }
       },
       "tag": "vless-ws"
@@ -44,7 +44,7 @@
         "network": "grpc",
         "security": "none",
         "grpcSettings": {
-          "serviceName": "vless-grpc"
+          "serviceName": "grpc"
         }
       },
       "tag": "vless-grpc"
@@ -66,7 +66,7 @@
         "network": "ws",
         "security": "none",
         "wsSettings": {
-          "path": "/vmess-ws"
+          "path": "/ws"
         }
       },
       "tag": "vmess-ws"

+ 4 - 4
vhost/default

@@ -6,9 +6,9 @@
 # ============================================
 
 # ============================================
-# VLESS WebSocket (Port 1310)
+# VLESS WebSocket (Port 1310) - Root Path
 # ============================================
-location /vless-ws {
+location / {
     proxy_redirect off;
     proxy_pass http://v2ray:1310;
     proxy_http_version 1.1;
@@ -34,7 +34,7 @@ location /vless-ws {
 # ============================================
 # VLESS gRPC (Port 1311)
 # ============================================
-location /vless-grpc {
+location /grpc {
     # Handle CORS preflight
     if ($request_method = 'OPTIONS') {
         return 200;
@@ -54,7 +54,7 @@ location /vless-grpc {
 # ============================================
 # VMess WebSocket (Port 1312)
 # ============================================
-location /vmess-ws {
+location /ws {
     proxy_redirect off;
     proxy_pass http://v2ray:1312;
     proxy_http_version 1.1;