mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-07 21:30:36 -05:00
[PR #2831] feat: websocket relay #11979
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fosrl/pangolin/pull/2831
Author: @nicholasliverett
Created: 4/11/2026
Status: 🔄 Open
Base:
dev← Head:feature-websocket-relay📝 Commits (4)
58a1564Add WebSocket relay tunnel bridge and config5d1a234dont show wildcard in domain picker1f57ff7Update WebSocket relay configuration and fix port assignment09e1346fix: wss_relay_port📊 Changes
7 files changed (+373 additions, -11 deletions)
View changed files
📝
messages/en-US.json(+1 -0)📝
server/lib/readConfigFile.ts(+9 -0)📝
server/routers/olm/getOlmToken.ts(+15 -1)📝
server/routers/olm/handleOlmRelayMessage.ts(+9 -1)➕
server/routers/ws/relayTunnelBridge.ts(+314 -0)📝
server/routers/ws/ws.ts(+5 -0)📝
src/components/DomainPicker.tsx(+20 -9)📄 Description
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
What does this PR do?
You can read about the discussion related to this topic here: Transport flexiblity
As discussed, in more restrictive networks UDP connections may be completely blocked and clients are unable to connect to resources. To get around this we use a commonly allowed protocol: HTTPS, or more specifically websockets.
Description
OLM will try its normal direct UDP/hole punch and UDP relay. If OLM receives a relayEndpointWss (sent with relay info) it starts an 8s timer. Once that timer is up it switches from the shared UDP bind to a websocket bind. Traffic then flows OLM-(wss)->Pangolin-(tcp relay port)->Gerbil->Newt. Now since we are using a websocket the RTT is more than just raw wireguard, and it might be something to look into.
Note: the only thing changed is olm's connection to the gerbil relay, to newt nothing changes.
How to test?
Setup Pangolin, Gerbil, and Olm from companion PRs mentioned below and regular newt. Have to spin up pangolin, gerbil, newt, and olm to test this. Ideally checking, regular connections, restricted networks, and the force relay flag
Companion PRs
Gerbil: fosrl/gerbil#77
Olm: fosrl/olm#112
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.