Giter VIP home page Giter VIP logo

Comments (10)

kaaass avatar kaaass commented on July 30, 2024

感谢提案。不过我印象中 tcp relay 是会把所有流量都通过 relay 服务器发送(包括 p2p 连接),主要是作为一种 udp 不可用的备选方案。这种方案会不会偏离了原本想解决的问题?

from zerotierfix.

basncy avatar basncy commented on July 30, 2024

zt-tcp-relay就是҄udp over tcp的方案. 在跨运营商udp限速的前提下, tcp中转速度好҄于udp直连.
只需一方按需配置即可, zt-tcp-relay可以理解为zt专用҃的tcp vpn,并且支持upnp端口映射.

from zerotierfix.

kaaass avatar kaaass commented on July 30, 2024

参考 zt-tcp-relay README 的图例,这个和普通的 UDP over TCP(e.g., udp2raw)、TCP 中转(e.g., Tailscale DERP)都是不同的。对于客户端来说,Zerotier 的 TCP Relay 几乎等价于使用 TCP 连接到了一个透明代理。以 VL1 层下 Zerotier 节点 A 向 B 连接为例:

  • 使用前:A --UDP--> B
  • 使用后:A --TCP--> 中转 --UDP--> B
  • 并不是:A --TCP--> B

换言之,TCP Relay 后的 A 节点在 Zerotier 网络看来,它的 IP 就是 TCP Relay 的 IP。这也就意味着 A 向所有节点连接的带宽总和 ≤ 中转节点带宽。同时也要求中转节点到 B 节点的 UDP 连接质量良好,不会被限速。虽然不确定你的使用场景,不过这个方案的限制其实还是比较大的。

from zerotierfix.

kaaass avatar kaaass commented on July 30, 2024

当然对 tcp relay 配置这个 Feature,Zerotier Fix 是很乐意添加的 :)

from zerotierfix.

basncy avatar basncy commented on July 30, 2024

我的情况是҄AB跨运营商, B与zt-tcp-relay同运营商.
zt-tcp-relay作为跨运营商的入口结点, 可以解决限速问题, 比如跨运营商访问Home NAS.

from zerotierfix.

basncy avatar basncy commented on July 30, 2024

补充说明一下,如果A是资源请求方(比如手机), 可能接入各种v4 only的墙中墙网络环境, 这时给配个TCP relay还是҄不错的.
至于中转到 B 的UDP链接质量, 把它҃们(relay和B)放在同一机器或局域网҄上就行了҄; 或者给B也配上Relay达到A --TCP-- 中转 --TCP-- B(未测试,感觉没必要)
带宽问题: 部署多个zt-tcp-relay做DNS负载均衡, 或自选优选节点.

from zerotierfix.

basncy avatar basncy commented on July 30, 2024

@kaaass 请问有没有更新计划呢? 看了҄一下ZerotierFix的源代码, 没找到哪里可以调用自҄定义的local.conf, 难道只能通过函数调用来下发配置吗?

from zerotierfix.

kaaass avatar kaaass commented on July 30, 2024

@basncy 抱歉我最近个人很忙,短期内应该没有计划做新功能了

可以直接在 APP 的 Data 目录(/data/data/net.kaaass.zerotierfix/files)下面增加一个 local.conf 文件。如果设备没有 ROOT 的话,可以考虑修改下源码。大致需要在这个逻辑之前写入 local.conf 文件。

// 启动 ZT 服务
synchronized (this) {

from zerotierfix.

basncy avatar basncy commented on July 30, 2024

@basncy 抱歉我最近个人很忙,短期内应该没有计划做新功能了

可以直接在 APP 的 Data 目录(/data/data/net.kaaass.zerotierfix/files)下面增加一个 local.conf 文件。如果设备没有 ROOT 的话,可以考虑修改下源码。大致需要在这个逻辑之前写入 local.conf 文件。

好像不会加载local.conf, tcp-proxy server那边没看҉到log

cat /data/data/net.kaaass.zerotierfix/files/local.conf
{"settings": {"primaryPort": "1994", "forceTcpRelay": "true", "tcpFallbackRelay": "192.168.1.2/1995"}}

libzt里有api, 但是ZeroTierOne里面没找到
https://github.com/zerotier/libzt/blob/2f0f25a15870ac0ae52815558c539e63d656d506/include/ZeroTierSockets.h#L1301
https://github.com/zerotier/ZeroTierOne/blob/dev/node/Topology.hpp

from zerotierfix.

kaaass avatar kaaass commented on July 30, 2024

@basncy 抱歉,看了下代码的确没有这个功能。PC 端的 TCP Relay 是实现在 Service 中的,然而 Java SDK 并没有使用这个 Service 实现。简而言之,就是 Zerotier Fix 需要自行实现 TCP Relay 的协议细节,包括决定何时从 UDP 协议切换到 TCP 中继。

基于此,这个 Feature 的实现难度和此前评估的有非常大的差异,很遗憾暂时应该不会考虑实现了。如果还有朋友也有 TCP Relay 需求,可以回复这个 Issue 或者 Vote 一个 Thumb 表情,如果有比较多需求的话我会重新考虑。同时也欢迎代码 PR。

from zerotierfix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.