add tcp hole punching (#1713)

add tcp hole punching and tcp stun test
This commit is contained in:
KKRainbow authored and GitHub committed 2025-12-28 21:35:30 +08:00
1 parent 37531507db
commit c19cd1bff3
29 files changed
+1502 -300

No files matched your search

+3 -1
View File
@@ -1470,7 +1470,9 @@ async fn main() -> Result<(), Error> {
let collector = StunInfoCollector::new_with_default_servers();
loop {
let ret = collector.get_stun_info();
if ret.udp_nat_type != NatType::Unknown as i32 {
if ret.udp_nat_type != NatType::Unknown as i32
&& ret.tcp_nat_type != NatType::Unknown as i32
{
if cli.output_format == OutputFormat::Json {
match serde_json::to_string_pretty(&ret) {
Ok(json) => println!("{}", json),