[PR #2132] [MERGED] Add compatibility with only websocket-capable clients #2516

Closed
opened 2025-12-29 03:21:37 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/2132
Author: @enoperm
Created: 9/13/2024
Status: Merged
Merged: 9/21/2024
Merged by: @kradalby

Base: mainHead: websocket-control-protocol


📝 Commits (10+)

  • cd89834 handle control protocol through websocket
  • 18c89c3 get DERP-over-websocket working for wasm clients
  • a2d5143 Prepare for testing builtin websocket-over-DERP
  • 73e3383 integration tests: properly differentiate between DERP transports
  • 6850d31 do not touch unrelated code
  • be08dbc linter fixes
  • 6853e83 Merge remote-tracking branch 'origin/main' into websocket-control-protocol
  • f509a43 integration testing: unexport common implementation of derp server scenario
  • 4fe9ba3 fixup! integration testing: unexport common implementation of derp server scenario
  • 1a6b21a dockertestutil/logs: remove unhelpful comment

📊 Changes

14 files changed (+277 additions, -34 deletions)

View changed files

📝 .github/workflows/test-integration.yaml (+1 -0)
📝 CHANGELOG.md (+5 -1)
📝 go.mod (+1 -1)
📝 hscontrol/app.go (+1 -1)
📝 hscontrol/derp/server/derp_server.go (+53 -0)
📝 hscontrol/types/users.go (+1 -1)
📝 hscontrol/util/net.go (+0 -1)
📝 integration/dns_test.go (+0 -1)
📝 integration/dockertestutil/logs.go (+22 -14)
📝 integration/embedded_derp_test.go (+105 -13)
📝 integration/hsic/hsic.go (+6 -0)
📝 integration/tailscale.go (+3 -0)
📝 integration/tsic/tsic.go (+37 -0)
📝 integration/utils.go (+42 -1)

📄 Description

  • have read the CONTRIBUTING.md file
  • raised a GitHub issue or discussed it on the projects chat beforehand
  • added unit tests
  • added integration tests
  • updated documentation if needed
  • updated CHANGELOG.md

I have not touched CHANGELOG.md, as I can see Headscale already entered a release candidate phase and I do not expect anything other than bugfixes would be accepted at this point. I'll do so if/when the changes are deemed acceptable and it is clear what version of Headscale they may become a part of.

This is not a new feature, nor does it change the configuration, the patches merely improve compatibility with existing Tailscale client code, hence no documentation changes (although I'm considering that maybe it could save someone a bunch of debugging if the docs mentioned that the Tailscale DERP-over-websocket code ignores the port number in the configured DERP map).

I'd refrain from calling these changes a bugfix, though, because not supporting a (currently entirely optional) client capability does not quite sound like a bug.

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced WebSocket support for the DERP server, allowing better communication and flexibility.
    • Added new logging capabilities for Tailscale clients and containers, improving debugging and monitoring.
    • Introduced a configuration option to enable or disable WebSocket DERP connections.
    • New test scenarios for validating client configurations with WebSocket and plain connections.
    • Added a new test case specifically for WebSocket interactions with the DERP server.
  • Bug Fixes

    • Improved error handling in integration tests to enhance robustness.
  • Tests

    • Expanded testing coverage for WebSocket interactions and DERP server scenarios.

🔄 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/juanfont/headscale/pull/2132 **Author:** [@enoperm](https://github.com/enoperm) **Created:** 9/13/2024 **Status:** ✅ Merged **Merged:** 9/21/2024 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `websocket-control-protocol` --- ### 📝 Commits (10+) - [`cd89834`](https://github.com/juanfont/headscale/commit/cd898345a7a50e6684ce5ad4d7cd3c737b755bb7) handle control protocol through websocket - [`18c89c3`](https://github.com/juanfont/headscale/commit/18c89c3188c2ef8063b997ab617e87bdfbaa9b56) get DERP-over-websocket working for wasm clients - [`a2d5143`](https://github.com/juanfont/headscale/commit/a2d5143908d829e415191de0a33cd8bc9214f0e1) Prepare for testing builtin websocket-over-DERP - [`73e3383`](https://github.com/juanfont/headscale/commit/73e338357b813eb13de69e9bc0bf126159f26482) integration tests: properly differentiate between DERP transports - [`6850d31`](https://github.com/juanfont/headscale/commit/6850d31f0fdc9649fe11561437a5b85572a51378) do not touch unrelated code - [`be08dbc`](https://github.com/juanfont/headscale/commit/be08dbccc08cbe7d5c568e29cb5a39dd9312f485) linter fixes - [`6853e83`](https://github.com/juanfont/headscale/commit/6853e83e013628919b1cde5c0f3f49dcd171f9d9) Merge remote-tracking branch 'origin/main' into websocket-control-protocol - [`f509a43`](https://github.com/juanfont/headscale/commit/f509a4393d47334925cbc35455f9ec2476197e96) integration testing: unexport common implementation of derp server scenario - [`4fe9ba3`](https://github.com/juanfont/headscale/commit/4fe9ba3a7e3afba48ae4042d7871e4af5d5d2570) fixup! integration testing: unexport common implementation of derp server scenario - [`1a6b21a`](https://github.com/juanfont/headscale/commit/1a6b21a4cc13f43ed78007952e650dbf23bc80b7) dockertestutil/logs: remove unhelpful comment ### 📊 Changes **14 files changed** (+277 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/test-integration.yaml` (+1 -0) 📝 `CHANGELOG.md` (+5 -1) 📝 `go.mod` (+1 -1) 📝 `hscontrol/app.go` (+1 -1) 📝 `hscontrol/derp/server/derp_server.go` (+53 -0) 📝 `hscontrol/types/users.go` (+1 -1) 📝 `hscontrol/util/net.go` (+0 -1) 📝 `integration/dns_test.go` (+0 -1) 📝 `integration/dockertestutil/logs.go` (+22 -14) 📝 `integration/embedded_derp_test.go` (+105 -13) 📝 `integration/hsic/hsic.go` (+6 -0) 📝 `integration/tailscale.go` (+3 -0) 📝 `integration/tsic/tsic.go` (+37 -0) 📝 `integration/utils.go` (+42 -1) </details> ### 📄 Description <!-- Headscale is "Open Source, acknowledged contribution", this means that any contribution will have to be discussed with the Maintainers before being submitted. This model has been chosen to reduce the risk of burnout by limiting the maintenance overhead of reviewing and validating third-party code. Headscale is open to code contributions for bug fixes without discussion. If you find mistakes in the documentation, please submit a fix to the documentation. --> <!-- Please tick if the following things apply. You… --> - [x] have read the [CONTRIBUTING.md](./CONTRIBUTING.md) file - [x] raised a GitHub issue or discussed it on the projects chat beforehand - [ ] added unit tests - [x] added integration tests - [ ] updated documentation if needed - [x] updated CHANGELOG.md <!-- If applicable, please reference the issue using `Fixes #XXX` and add tests to cover your new code. --> I have not touched `CHANGELOG.md`, as I can see Headscale already entered a release candidate phase and I do not expect anything other than bugfixes would be accepted at this point. I'll do so if/when the changes are deemed acceptable and it is clear what version of Headscale they may become a part of. This is not a new feature, nor does it change the configuration, the patches merely improve compatibility with existing Tailscale client code, hence no documentation changes (although I'm considering that maybe it could save someone a bunch of debugging if the docs mentioned that the Tailscale DERP-over-websocket code ignores the port number in the configured DERP map). I'd refrain from calling these changes a *bugfix*, though, because not supporting a (currently entirely optional) client capability does not quite sound like a bug. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes - **New Features** - Enhanced WebSocket support for the DERP server, allowing better communication and flexibility. - Added new logging capabilities for Tailscale clients and containers, improving debugging and monitoring. - Introduced a configuration option to enable or disable WebSocket DERP connections. - New test scenarios for validating client configurations with WebSocket and plain connections. - Added a new test case specifically for WebSocket interactions with the DERP server. - **Bug Fixes** - Improved error handling in integration tests to enhance robustness. - **Tests** - Expanded testing coverage for WebSocket interactions and DERP server scenarios. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 03:21:37 +01:00
adam closed this issue 2025-12-29 03:21:37 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#2516