add tcp hole punching (#1713)

add tcp hole punching and tcp stun test
This commit is contained in:
KKRainbow
2025-12-28 21:35:30 +08:00
committed by GitHub
parent 37531507db
commit c19cd1bff3
29 changed files with 1502 additions and 300 deletions
+1
View File
@@ -80,6 +80,7 @@ message NetworkConfig {
optional bool p2p_only = 51;
optional common.CompressionAlgoPb data_compress_algo = 52;
optional string encryption_algorithm = 53;
optional bool disable_tcp_hole_punching = 54;
}
message PortForwardConfig {
+2
View File
@@ -62,6 +62,8 @@ message FlagsInConfig {
string tld_dns_zone = 31;
bool p2p_only = 32;
bool disable_tcp_hole_punching = 34;
}
message RpcDescriptor {
+11 -1
View File
@@ -13,7 +13,7 @@ message RoutePeerInfo {
optional common.Ipv4Addr ipv4_addr = 4;
repeated string proxy_cidrs = 5;
optional string hostname = 6;
common.NatType udp_stun_info = 7;
common.NatType udp_nat_type = 7;
google.protobuf.Timestamp last_update = 8;
uint32 version = 9;
@@ -27,6 +27,8 @@ message RoutePeerInfo {
optional common.Ipv6Inet ipv6_addr = 15;
repeated PeerGroupInfo groups = 16;
common.NatType tcp_nat_type = 17;
}
message PeerIdVersion {
@@ -207,6 +209,14 @@ service UdpHolePunchRpc {
returns (SendPunchPacketBothEasySymResponse);
}
message TcpHolePunchRequest { common.SocketAddr connector_mapped_addr = 1; }
message TcpHolePunchResponse { common.SocketAddr listener_mapped_addr = 1; }
service TcpHolePunchRpc {
rpc ExchangeMappedAddr(TcpHolePunchRequest) returns (TcpHolePunchResponse);
}
message DirectConnectedPeerInfo { int32 latency_ms = 1; }
message PeerInfoForGlobalMap {