[Feature] <title>Cloudflare Tunnel support #923

Closed
opened 2025-12-29 02:26:08 +01:00 by adam · 1 comment
Owner

Originally created by @IronBeardKnight on GitHub (Jan 26, 2025).

Use case

Tunneling headscale through cloudflare to save opening ports.

Description

So after getting it all up and running in docker and then being reverse proxied through traefik and cloudflare tunnel to the point where I can access the domain.com/windows and it shows a page I was pleased, however the fun stops there as the tailscale client uses post instead of get to form a WebSocket connection of which it does not look like headscale supports this.

It is entirely possible that either cloudflare or traefik is stripping a header but I cannot imagine which one or what the issue is considering I have traefik upgrading to websocket already.

Given this error directly from headscale makes me think that its more a headscale issue:

"Could not accept WebSocket connection failed to accept WebSocket connection: WebSocket protocol violation: handshake request method is not GET but "POST""

I know get is the standard for websocket connections but is it not possible to accommodate post for this some how?

I think a lot of the home hosting community steers away from this very fast due to the fact that poxy and tunnel through Cloudflare seems to be broken.

Is there any updated information on this subject as I know the documentation for headscale states cloudflare tunnel is not currently supported?

Contribution

  • I can write the design doc for this feature
  • I can contribute this feature

How can it be implemented?

No response

Originally created by @IronBeardKnight on GitHub (Jan 26, 2025). ### Use case Tunneling headscale through cloudflare to save opening ports. ### Description So after getting it all up and running in docker and then being reverse proxied through traefik and cloudflare tunnel to the point where I can access the domain.com/windows and it shows a page I was pleased, however the fun stops there as the tailscale client uses post instead of get to form a WebSocket connection of which it does not look like headscale supports this. It is entirely possible that either cloudflare or traefik is stripping a header but I cannot imagine which one or what the issue is considering I have traefik upgrading to websocket already. Given this error directly from headscale makes me think that its more a headscale issue: "Could not accept WebSocket connection failed to accept WebSocket connection: WebSocket protocol violation: handshake request method is not GET but \"POST\"" I know get is the standard for websocket connections but is it not possible to accommodate post for this some how? I think a lot of the home hosting community steers away from this very fast due to the fact that poxy and tunnel through Cloudflare seems to be broken. Is there any updated information on this subject as I know the documentation for headscale states cloudflare tunnel is not currently supported? ### Contribution - [ ] I can write the design doc for this feature - [ ] I can contribute this feature ### How can it be implemented? _No response_
adam added the enhancement label 2025-12-29 02:26:08 +01:00
adam closed this issue 2025-12-29 02:26:08 +01:00
Author
Owner

@kradalby commented on GitHub (Jan 26, 2025):

Duplicate of https://github.com/juanfont/headscale/issues/1468, this is an upstream part of protocol, might be intentional. Please search the issue tracker before creating issues.

@kradalby commented on GitHub (Jan 26, 2025): Duplicate of https://github.com/juanfont/headscale/issues/1468, this is an upstream part of protocol, might be intentional. Please search the issue tracker before creating issues.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#923