[PR #2962] [MERGED] [client] Add QUIC support #15902

Closed
opened 2026-08-05 03:08:38 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/2962
Author: @pappz
Created: 11/28/2024
Status: Merged
Merged: 1/15/2025
Merged by: @lixmal

Base: mainHead: relay/quic


📝 Commits (10+)

📊 Changes

25 files changed (+943 additions, -33 deletions)

View changed files

📝 .github/workflows/golang-test-darwin.yml (+2 -1)
📝 .github/workflows/golang-test-linux.yml (+3 -3)
📝 .github/workflows/golang-test-windows.yml (+1 -1)
📝 go.mod (+4 -0)
📝 go.sum (+6 -0)
📝 relay/client/client.go (+7 -8)
relay/client/dialer/net/err.go (+7 -0)
relay/client/dialer/quic/conn.go (+97 -0)
relay/client/dialer/quic/quic.go (+71 -0)
relay/client/dialer/race_dialer.go (+96 -0)
relay/client/dialer/race_dialer_test.go (+252 -0)
📝 relay/client/dialer/ws/addr.go (+5 -1)
📝 relay/client/dialer/ws/conn.go (+1 -0)
📝 relay/client/dialer/ws/ws.go (+13 -2)
relay/server/listener/quic/conn.go (+101 -0)
relay/server/listener/quic/listener.go (+66 -0)
📝 relay/server/listener/ws/listener.go (+2 -0)
📝 relay/server/relay.go (+3 -1)
📝 relay/server/server.go (+48 -16)
relay/tls/alpn.go (+3 -0)

...and 5 more files

📄 Description

Describe your changes

Add QUIC protocol support for Relay client and server
The Relay client tries to connect with WS and QUIC to Relay in parallel. After the successful connection is maintained, only one of them and the other will be aborted. The system architecture expects all Relay server instances to accept all protocols. The QUIC will listen on the same port number as the WS, just on UDP.

For the test and dev environment, the code generates a fake certificate for the QUIC server and it will automatically be accepted by the Relay client. It is configurable in build time with the -tags=devcert parameter. Keep in mind never to use binary that has been built with these flags in a production system.

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/2962 **Author:** [@pappz](https://github.com/pappz) **Created:** 11/28/2024 **Status:** ✅ Merged **Merged:** 1/15/2025 **Merged by:** [@lixmal](https://github.com/lixmal) **Base:** `main` ← **Head:** `relay/quic` --- ### 📝 Commits (10+) - [`8f5cefa`](https://github.com/netbirdio/netbird/commit/8f5cefaf3a5bc42fb2fae8d87602622f69729e3c) Update client/iface/bind/ice_bind.go - [`812b08c`](https://github.com/netbirdio/netbird/commit/812b08c473b4f7dce8b5cd31de3eae64bb7aa569) Lint ignore - [`b82b4a0`](https://github.com/netbirdio/netbird/commit/b82b4a07fc948b6e9c77ddc12104163957996c5f) Quic support - [`b23169d`](https://github.com/netbirdio/netbird/commit/b23169de63a74c825bf8e79389e2da4ff6bd84c3) Add quick listener - [`3a447c0`](https://github.com/netbirdio/netbird/commit/3a447c066b9b796319c8364e32e4cac8ce251fa2) Use custom dialer in QUIC - [`bca8944`](https://github.com/netbirdio/netbird/commit/bca8944e7ae8febf0648f7ca0df50f2f302eb27d) TLS configuration - [`ceb8a01`](https://github.com/netbirdio/netbird/commit/ceb8a0157302bb154b1148bc04922c2b3b819773) Fix next protos in dev env - [`9196104`](https://github.com/netbirdio/netbird/commit/9196104859e0c8743845e0c7afcbd65846c30f61) Add race dialer - [`b9e3c71`](https://github.com/netbirdio/netbird/commit/b9e3c71f402a4ebba112f1f45ab5de080efebdd2) Fix missing imports - [`5d4899c`](https://github.com/netbirdio/netbird/commit/5d4899cb783c035a5869b81dbdf9019f46b288fd) Fix logging and error handling ### 📊 Changes **25 files changed** (+943 additions, -33 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/golang-test-darwin.yml` (+2 -1) 📝 `.github/workflows/golang-test-linux.yml` (+3 -3) 📝 `.github/workflows/golang-test-windows.yml` (+1 -1) 📝 `go.mod` (+4 -0) 📝 `go.sum` (+6 -0) 📝 `relay/client/client.go` (+7 -8) ➕ `relay/client/dialer/net/err.go` (+7 -0) ➕ `relay/client/dialer/quic/conn.go` (+97 -0) ➕ `relay/client/dialer/quic/quic.go` (+71 -0) ➕ `relay/client/dialer/race_dialer.go` (+96 -0) ➕ `relay/client/dialer/race_dialer_test.go` (+252 -0) 📝 `relay/client/dialer/ws/addr.go` (+5 -1) 📝 `relay/client/dialer/ws/conn.go` (+1 -0) 📝 `relay/client/dialer/ws/ws.go` (+13 -2) ➕ `relay/server/listener/quic/conn.go` (+101 -0) ➕ `relay/server/listener/quic/listener.go` (+66 -0) 📝 `relay/server/listener/ws/listener.go` (+2 -0) 📝 `relay/server/relay.go` (+3 -1) 📝 `relay/server/server.go` (+48 -16) ➕ `relay/tls/alpn.go` (+3 -0) _...and 5 more files_ </details> ### 📄 Description ## Describe your changes Add QUIC protocol support for Relay client and server The Relay client tries to connect with WS and QUIC to Relay in parallel. After the successful connection is maintained, only one of them and the other will be aborted. The system architecture expects all Relay server instances to accept all protocols. The QUIC will listen on the same port number as the WS, just on UDP. For the test and dev environment, the code generates a fake certificate for the QUIC server and it will automatically be accepted by the Relay client. It is configurable in build time with the `-tags=devcert` parameter. Keep in mind never to use binary that has been built with these flags in a production system. ## Issue ticket number and link ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] Extended the README / documentation, if necessary --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 03:08:38 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#15902