Allow self-hosted relays to opt into wss:// (#767)
* Add relay TLS schema fields * Wire relay TLS into websocket URLs * Propagate relay TLS from pairing offers * Expose relay TLS opt-in * Mark relay TLS fallback for removal * Preserve explicit relay TLS false * Align relay TLS defaults outside config loader
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
buildDaemonWebSocketUrl,
|
||||
buildRelayWebSocketUrl,
|
||||
CURRENT_RELAY_PROTOCOL_VERSION,
|
||||
extractHostPortFromWebSocketUrl,
|
||||
normalizeRelayProtocolVersion,
|
||||
parseConnectionUri,
|
||||
serializeConnectionUri,
|
||||
@@ -173,4 +174,17 @@ describe("relay websocket URLs", () => {
|
||||
|
||||
expect(url.protocol).toBe("wss:");
|
||||
});
|
||||
|
||||
test("round-trips IPv6 relay endpoints with TLS enabled", () => {
|
||||
const wsUrl = buildRelayWebSocketUrl({
|
||||
endpoint: "[::1]:443",
|
||||
useTls: true,
|
||||
serverId: "srv_test",
|
||||
role: "client",
|
||||
});
|
||||
const url = new URL(wsUrl);
|
||||
|
||||
expect(url.protocol).toBe("wss:");
|
||||
expect(extractHostPortFromWebSocketUrl(wsUrl)).toBe("[::1]:443");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user