@
gamexg 这个方法看上去可行,还是免费的。我会试试,多谢多谢!
这里摘录一段 ZeroTier 的工作方式,供有兴趣的人参考,我理解的大概就是有个服务端的管理程序,帮你的两台机器完成 p2p 连接,然后服务器就撒手不管,类似 teamview 的工作方式:
摘自
https://www.zerotier.com/manual.shtmlPeer to peer connection setup goes like this:
1. A wants to send a packet to B, but since it has no direct path it sends it upstream to R (a root).
If R has a direct link to B, it forwards the packet there. Otherwise it sends the packet upstream until planetary roots are reached. Planetary roots know about all nodes, so eventually the packet will reach B if B is online.
2. R also sends a message called rendezvous to A containing hints about how it might reach B. Meanwhile the root that forwards the packet to B sends rendezvous informing B how it might reach A.
3. A and B get their rendezvous messages and attempt to send test messages to each other, possibly accomplishing hole punching of any NATs or stateful firewalls that happen to be in the way. If this works a direct link is established and packets no longer need to take the scenic route.
4. Since roots forward packets, A and B can reach each other instantly. A and B then begin attempting to make a direct peer to peer connection. If this succeeds it results in a faster lower latency link. We call this transport triggered link provisioning since it's the forwarding of the packet itself that triggers the peer to peer network to attempt direct connection.