Files
yggdrasil-go/src/core
Ascii Moth 2cc8e7506e Allow WebSocket listeners to configure browser origins (#1342)
Adds an `origin` query option for `ws://` listener URLs so peer
operators can
explicitly allow browser-hosted WebSocket clients.

- `ws://host:port` keeps the existing same-origin behavior
- `ws://host:port?origin=demo.example.org` allows that origin host
- `ws://host:port?origin=https://demo.example.org` allows that scheme
and host
- repeated `origin=` parameters allow multiple origin patterns
- `origin=*` intentionally disables origin verification for public
WebSocket
  peer endpoints

## Problem
I've implemented a WASM based browser demo yggdrasil node to found that
it
cannot directly dial any existing public `ws://` or `wss://` peers.

Browsers always include an `Origin` header in WebSocket handshakes, and
the
JavaScript `WebSocket()` constructor does not allow applications to
override or
remove arbitrary handshake headers.  
This means a browser demo served from an origin such as
`http://127.0.0.1:8000` cannot connect to a public peer whose WebSocket
server
only accepts same-origin handshakes.
2026-05-12 21:40:59 +01:00
..
2026-01-18 14:51:52 +00:00
2026-01-18 14:51:52 +00:00
2023-11-28 13:24:54 +00:00
2026-01-18 14:51:52 +00:00
2026-01-18 14:51:52 +00:00
2026-01-18 15:04:28 +00:00
2026-01-18 14:51:52 +00:00
2024-11-17 21:14:54 +00:00
2026-01-18 14:51:52 +00:00
2026-02-23 22:55:06 +00:00
2026-01-18 14:51:52 +00:00
2024-11-17 21:14:54 +00:00
2023-05-21 12:49:49 -05:00
2023-10-15 23:06:10 +01:00