一、Nginx 配置

location /sgip {
    grpc_set_header Host $host;
    grpc_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    grpc_set_header X-Real-IP $remote_addr;

    grpc_read_timeout 600s;
    grpc_send_timeout 600s;

    # 替换为实际的IP和端口
    grpc_pass grpc://172.17.0.2:1090;
}

二、服务端

05_inbounds.json

{
  "inbounds": [
    {
      "listen": "0.0.0.0",
      "port": 1090,
      "protocol": "vless",
      "settings": {
        "clients": [
          {
            "id": "bcd85299-ac78-48b8-ae2e-37f29ddbc588"
          }
        ],
        "decryption": "none"
      },
      "streamSettings": {
        "network": "xhttp",
        "security": "none",
        "xhttpSettings": {
          "path": "/xhttp",
          "mode": "stream-up"
        }
      }
    }
  ]
}

06_outbounds.json

{
  "outbounds": [
    {
        "protocol": "freedom",
        "tag": "direct"
    }
  ]
}

三、客户端

{
  "outbounds": [
    {
      "protocol": "vless",
      "settings": {
        "vnext": [
          {
            "address": "example.com",
            "port": 443,
            "users": [
              {
                "id": "bcd85299-ac78-48b8-ae2e-37f29ddbc588",
                "encryption": "none"
              }
            ]
          }
        ]
      },
      "streamSettings": {
        "network": "xhttp",
        "security": "tls",
        "tlsSettings": {
          "serverName": "example.com",
          "alpn": [
            "h2"
          ]
        },
        "xhttpSettings": {
          "host": "example.com",
          "path": "/xhttp",
          "mode": "stream-up"
        }
      }
    }
  ]
}

标签: none

添加新评论