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
+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 {