Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

文档中 proxySettings 问题 #306

Closed
ToutyRater opened this issue Dec 4, 2016 · 2 comments
Closed

文档中 proxySettings 问题 #306

ToutyRater opened this issue Dec 4, 2016 · 2 comments

Comments

@ToutyRater
Copy link
Contributor

version: v2.8

文档中关于 proxySettings 的说明是这样的:

  • proxySettings: 传出代理配置。
    • tag: 当指定另一个传出协议的标识时,此传出协议发出的数据,将被转发至所指定的传出协议发出。

这段说明我琢磨了一段时间仍然觉得不通畅。以下是我客户端配置传出部分(路由已配置传出为 NewArukasTCP):

  "outboundDetour": [
    {
      "protocol": "vmess",
      "settings": {
        "vnext": [
          {
            "address": "45.*.*.*",
            "port": xxxx,
            "users": [
              {
                "alterId": 31,
                "id": "XXXX"
              }
            ]
          }
        ]
      },
      "tag": "USTCP"
    },
    {
      "proxySettings": {
        "tag": "USTCP"
      },
      "protocol": "vmess",
      "settings": {
        "vnext": [
          {
            "address": "153.*.*.*",
            "port": xxxx,
            "users": [
              {
                "alterId": 31,
                "id": "XXXX"
              }
            ]
          }
        ]
      },
      "tag": "NewArukasTCP"
    }
  ]

按照说明,我的理解是:
此传出协议为 NewArukasTCP ,指定的传出协议为 USTCP ,数据将按这样路径发送: PC --> NewArukasTCP --> USTCP --> web sever
然而,我通过 wireshark 抓包发现 PC 上的数据包都是发往 45.*.*.* 也就是 USTCP:
wireshark
与此同时,v2ray log 有这样的输出:

[Info]VMess|Outbound: Tunneling request to tcp:153.*.*.*:xxxx via tcp:45.*.*.*:xxxx
[Info]Socks: TCP Connect request to tcp:api.github.com:443
[Info]DefaultDispatcher: Taking detour [NewArukasTCP] for [tcp:api.github.com:443].
[Info]Internet: Proxying outbound connection through: USTCP

并且通过 whatismyip 查询得:
ip
以上几点说明了数据实际上是以 PC -->USTCP --> NewArukasTCP --> web sever 这样的路径发送的,与我看文档理解的 PC --> NewArukasTCP --> USTCP --> web sever 并不一样。
造成这样的问题的原因不知道是我理解不对还是文档确实写错了?

@v2ray
Copy link
Collaborator

v2ray commented Dec 4, 2016

此传出协议为 NewArukasTCP ,指定的传出协议为 USTCP,这个理解是对的。

此传出协议发出的数据,将被转发至所指定的传出协议发出,这个转发发生在本地,于是由 NewArukasTCP 发出(到 153.x.x.x)的数据,被全部转给了 USTCP,然后 USTCP 把所有数据发给自己的服务器(45.x.x.x)。如果 45.x.x.x 的出口是 freedom 的话,这个 freedom 会拿到发送到 NewArukasTCP 的指示,再将数据发给原本 NewArukasTCP 指定的服务器。

简而言之:PC -> USTCP -> NewArukasTCP -> web server。

@ToutyRater
Copy link
Contributor Author

明白了。原来关键在于转发发生在本地,一开始没有这样子想造成了误解。

github-actions bot pushed a commit to 3gZ2jA/v2ray-core that referenced this issue Oct 12, 2020
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from v2 to v2.2.1.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](golangci/golangci-lint-action@v2...54a84d4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant