V2ray-core: 应该如何配置中转服务器(非issue )

Created on 1 Aug 2018  ·  5Comments  ·  Source: v2ray/v2ray-core

1) 希望达到的效果

  • 通过国内的服务器中转至国外的服务器并成功代理
  • 国内的服务器为WebSocket+TLS+Web
  • 国外服务器未TLS

2) 国内外服务器正在使用V2Ray版本均为V3.33

3) 目前的情况:

  • 使用电脑连接国外服务器可以实现代理上网,无任何问题
  • 在不配置国内服务器outbound的情况下,可以实现国内服务器代理上网,无任何问题
  • 在国内中转服务器上配置outbound之后,无网络

4) 配置

国外服务器端配置:
{
    "inbound":
    {
        "port": 443,
        "protocol": "vmess",
        "settings":
        {
            "clients": [
            {
                "id": "………………",
                "alterId": 64
            }]
        },
        "streamSettings":
        {
            "network": "tcp",
            "security": "tls",
            "tlsSettings":
            {
                "certificates": [
                {
                    "certificateFile": "/etc/v2ray/v2ray.crt",
                    "keyFile": "/etc/v2ray/v2ray.key"
                }]
            }
        }
    },
    "outbound":
    {
        "protocol": "freedom",
        "settings":
        {}
    }
}
国内中转服务器配置:
{
    "inbound":
    {
        "port": 10000,
        "listen": "127.0.0.1",
        "protocol": "vmess",
        "settings":
        {
            "clients": [
            {
                "id": "………………",
                "alterId": 64
            }]
        },
        "streamSettings":
        {
            "network": "ws",
            "wsSettings":
            {
                "path": "/myray"
            }
        }
    },
    "outbound":
    {
        "protocol": "vmess",
        "settings":
        {
            "vnext": [
            {
                "address": "国外服务器URL",
                "port": 443,
                "users": [
                {
                    "id": "**********",
                    "alterId": 64
                }]
            }]
        }
    }
}
客户端配置:
{
  "inbound": {
    "port": 1080,
    "listen": "127.0.0.1",
    "protocol": "socks",
    "domainOverride": ["tls","http"],
    "settings": {
      "auth": "noauth",
      "udp": false
    }
  },
  "outbound": {
    "protocol": "vmess",
    "settings": {
      "vnext": [
        {
          "address": "国内服务器URL",
          "port": 443,
          "users": [
            {
              "id": "………………",
              "alterId": 64
            }
          ]
        }
      ]
    },
    "streamSettings": {
      "network": "ws",
      "security": "tls",
      "wsSettings": {
        "path": "/myray"
      }
    }
  }
}

麻烦各位大神了!

Most helpful comment

因为国外服务器开了Tls所以中转服务器的outbound也应该开tls
即中转服务器outbound中添加以下配置

  "streamSettings": {
    "network": "tcp",
    "security": "tls",
    "tlsSettings": {
      "allowInsecure": true  // 因证书是自签发的
    }
  }

注:只在本地环境测试过,可能还有配置以外的因素影响。

All 5 comments

因为国外服务器开了Tls所以中转服务器的outbound也应该开tls
即中转服务器outbound中添加以下配置

  "streamSettings": {
    "network": "tcp",
    "security": "tls",
    "tlsSettings": {
      "allowInsecure": true  // 因证书是自签发的
    }
  }

注:只在本地环境测试过,可能还有配置以外的因素影响。

@nobody3u 感谢,完美解决!😊

国外的服务器不是没开tls么?

国内服务器入站流量还需要vemss加密么?

其实中转服务器,直接使用Dokodemo-door协议转发流量即可。
或者使用其他中转服务,iptables brook等

Was this page helpful?
0 / 5 - 0 ratings

Related issues

supersndqd picture supersndqd  ·  3Comments

nielspeen picture nielspeen  ·  4Comments

sunsan05 picture sunsan05  ·  3Comments

limaofu picture limaofu  ·  3Comments

supersonic600 picture supersonic600  ·  3Comments