Commit Graph
15 Commits
Author SHA1 Message Date
rustdeskandClaude Fable 5.1 7a5ad5252e socket_client: only the controller's NAT test takes the resolver's address
`new_direct_udp_for` is back on `test_target`. The punch reply the
controlled side sends with it goes to the address it picks, and that reply
lost is a device online and unreachable - so it keeps the handshake that
proves the address, as the registration does. The controller's NAT test,
once per connection, is what could not afford the proof, a round trip
right before the connection it then opens to the same host; it alone takes
the resolver's preferred address, as `new_direct_udp_for_unverified`, and
a wrong one there costs that connection its UDP punch and nothing more.

That lookup is the first on the controller's connection path and the one
not under CONNECT_TIMEOUT, so it gets a second: a resolver that hangs
would otherwise hold the connection for its whole retry schedule before
`connect_tcp` even starts, and what a slower lookup loses is, again, only
the NAT test.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019aokqJuhjvB3kijXtAg5Ns
2026-09-19 00:18:16 +08:00
rustdeskandClaude Fable 5.1 0bc83361d6 socket_client: the rendezvous registration keeps its proven address
f688d41 replaced the TCP handshake in `test_target` with the resolver's
first answer for every caller. The two are the same when an IPv6 route is
missing, or leads to nothing: a v6-only host gets the synthesized address
first either way, and the handshake sat out its second on a black hole and
fell back to that same first answer. They differ when the server refuses
IPv6 outright - an AAAA published for a daemon bound to 0.0.0.0, a firewall
that rejects - where the handshake failed fast and moved on to the A
record, and the resolver's order stays on the AAAA.

That matters on one path. `new_udp_for` and `rebind_udp_for` choose the
address the rendezvous registration lives on, and `start_udp` never leaves
UDP for TCP nor asks for a second candidate: a rebind after `MAX_FAILS2`
calls the same function and gets the same address. A self-hosted server
with such an AAAA would never see the controlled side register. Those two
keep the handshake, one round trip per server connection, under the old
name and its old behaviour. `new_direct_udp_for`, per connection and
against servers whose records are ours, takes the resolver's answer as
`resolve_target`: the round trip it was spared stays spared.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019aokqJuhjvB3kijXtAg5Ns
2026-09-18 16:05:50 +08:00
rustdeskandClaude Fable 5.1 f688d4116c socket_client: resolve the UDP target, do not shake hands with it
`test_target` opened a TCP connection to the rendezvous server to learn
which address the kernel would use, then dropped it: a full handshake, one
round trip, on every connection the controller starts, before the one
`_start_inner` opens to the same host a moment later - and a second's wait
first wherever an IPv6 route led to nothing, before it fell back to the
resolver anyway.

The handshake stood in for a choice that had been made by hand: before
2022's NAT64 fix the code preferred an A record outright, which a v6-only
host cannot reach, and asking the server itself was the way to let the OS
decide. The resolver decides the same way. getaddrinfo orders what it
returns as RFC 6724 says, looking up a route and a source address for each
candidate as it goes, so the synthesized IPv6 comes first on a v6-only host
and IPv6 on a dual-stack one, the order the handshake would have tried
them in. Its first answer is the address, and the fallback branch is all
that is left.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019aokqJuhjvB3kijXtAg5Ns
2026-09-18 15:40:50 +08:00
lc 7cb29b1117 add ice-servers config 2025-11-16 18:43:31 +08:00
lc 0da5d379fc support turn relay config, and force_relay option 2025-11-16 04:04:25 +08:00
lc 8ae4651bc7 make webrtc-rs optional feature 2025-11-13 16:53:07 +08:00
lc 442160d704 add webrtc stream 2025-11-12 19:46:55 +08:00
RustDesk df95f44499 more udp punch 2025-06-10 12:01:43 +08:00
21pages 585bd1f152 websocket
Signed-off-by: 21pages <sunboeasy@gmail.com>
2025-05-08 18:20:38 +08:00
YinMo19 4ff800a8be [test] websocket should be determined in runtime. 2025-04-23 09:00:29 +08:00
YinMo19 6798bf3780 [test] tcp success. Websocket test. (temp ver.) 2025-04-23 08:33:01 +08:00
YinMo19 2d65c24e4b [enhance] remove cfg select. 2025-04-18 11:31:46 +08:00
YinMo19 58103659e7 [enhance] add websocket NOT a config feature. 2025-04-18 02:53:39 +08:00
YinMo19 c156d2eef7 [enhance] websocket 2025-04-17 11:42:58 +08:00
21pages 49c6b24a7a init
Signed-off-by: 21pages <sunboeasy@gmail.com>
2025-01-20 16:06:27 +08:00