Skip to content

feat(rendezvous): add UDP punch negotiation fields - #581

Open
Bia503 wants to merge 1 commit into
rustdesk:mainfrom
Bia503:codex/udp-hole-punch-proto-pr
Open

feat(rendezvous): add UDP punch negotiation fields#581
Bia503 wants to merge 1 commit into
rustdesk:mainfrom
Bia503:codex/udp-hole-punch-proto-pr

Conversation

@Bia503

@Bia503 Bia503 commented Aug 12, 2026

Copy link
Copy Markdown

Summary

Adds wire-compatible rendezvous protocol fields required for authenticated UDP hole-punch negotiation:

  • TestNatRequest.nonce
  • TestNatResponse.nonce
  • PunchHole.udp_punch_token
  • PunchHoleSent.udp_punch_token
  • RegisterPk.udp_punch_token_supported

Motivation

The existing UDP candidate path does not have a server-verified completion signal.
These fields allow a rendezvous server to:

  • bind UDP completion to a short-lived, single-use token;
  • verify NAT test replies belong to the active request;
  • negotiate the feature only with clients that explicitly support it.

All fields are additive protobuf fields. Older clients and servers ignore them and
continue using the existing TCP/relay flow.

Follow-up

Client and hbbs support will be submitted separately after this protocol change.

Summary by CodeRabbit

  • New Features
    • Added support for UDP punch tokens during connection setup.
    • Added nonce exchange for NAT connectivity testing.
    • Added capability signaling for UDP punch token support.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6e3ac6fb-fdb6-412e-b3bf-3caa3ff66b1b

📥 Commits

Reviewing files that changed from the base of the PR and between f124c0a and 3a39904.

📒 Files selected for processing (1)
  • protos/rendezvous.proto

📝 Walkthrough

Walkthrough

The rendezvous protobuf definitions add UDP punch token fields, NAT test nonces, and a registration capability flag.

Changes

Rendezvous protocol

Layer / File(s) Summary
Rendezvous message fields
protos/rendezvous.proto
PunchHole and PunchHoleSent now carry UDP punch tokens. TestNatRequest and TestNatResponse now carry nonces. RegisterPk now reports UDP punch token support.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: rustdesk, 21pages

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the addition of UDP punch negotiation fields in the rendezvous protocol.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@rustdesk rustdesk closed this Aug 13, 2026
@rustdesk rustdesk reopened this Aug 13, 2026
@Bia503

Bia503 commented Aug 15, 2026

Copy link
Copy Markdown
Author

FYI, I’m holding the follow-up client/hbbs PRs for now, since they depend on this protocol change and won’t pass CI against the current hbb_common.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants