diff --git a/README.md b/README.md index d32277e..9154df0 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ explicit opt-in by both people; no relay is configured automatically. ## How it works -1. The sender picks one file and configures STUN (Google by default, Cloudflare, - a custom provider, or None). They create a code and send it privately to the - intended receiver through an authenticated channel. +1. The sender picks one file and configures STUN (PageQuit by default, Google, + Cloudflare, a custom provider, or None). They create a code and send it + privately to the intended receiver through an authenticated channel. 2. The receiver pastes the code, creates an answer, and sends it back. The sender pastes the answer. Gathering waits for completion, up to 30 seconds; a timeout fails rather than quietly exporting incomplete connection information. @@ -249,7 +249,7 @@ The browser check requires Chromium at `/usr/bin/chromium` (override with The cross-browser check uses Brave and Firefox at `/usr/bin/brave` and `/usr/bin/firefox` (override with `BRAVE_PATH` and `FIREFOX_PATH`). It checks that the received file remains downloadable after the sender disconnects. -Pass `--reverse` to test Firefox → Brave, or `--default-network` to use Google +Pass `--reverse` to test Firefox → Brave, or `--default-network` to use PageQuit STUN instead of the local test's default None. These checks use temporary browser profiles and do not modify your normal browser settings. diff --git a/scripts/browser-check.ts b/scripts/browser-check.ts index d3b1760..f7a0e46 100644 --- a/scripts/browser-check.ts +++ b/scripts/browser-check.ts @@ -10,7 +10,7 @@ import { dirname, extname, join, resolve } from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; const root = resolve(dirname(fileURLToPath(import.meta.url)), '..'); const axeSource = await readFile(join(root, 'node_modules/axe-core/axe.min.js'), 'utf8'); -const provider = process.argv.includes('--default-network') ? 'google' : 'none'; +const provider = process.argv.includes('--default-network') ? 'pagequit' : 'none'; const turn = process.argv.includes('--turn'); const transport = process.argv.includes('--tcp') ? 'tcp' : 'udp'; const vite = turn ? await (await import('vite')).createServer({ server: { middlewareMode: true }, appType: 'spa' }) : null; @@ -160,9 +160,13 @@ async function connect(sender: string, receiver: string, size: number) { } try { const sender = await page(), receiver = await page(); + if (!turn) { + assert.equal(await evaluate(sender, () => document.querySelector('#stun-provider')?.value), 'pagequit'); + } if (!turn) { const localUrl = pathToFileURL(join(root, 'dist/hellcon-local.html')).href; const localReceiver = await page(localUrl); + assert.equal(await evaluate(localReceiver, () => document.querySelector('#stun-provider')?.value), 'pagequit'); assert.equal(await evaluate(localReceiver, () => document.querySelector('h1')?.textContent), 'HellCon'); await click(localReceiver, 'Receive'); assert.equal(await evaluate(localReceiver, () => !!document.querySelector('#offer-input')), true); diff --git a/scripts/cross-browser-check.ts b/scripts/cross-browser-check.ts index 766d4bb..cdbc13a 100644 --- a/scripts/cross-browser-check.ts +++ b/scripts/cross-browser-check.ts @@ -13,7 +13,7 @@ const root = resolve(dirname(fileURLToPath(import.meta.url)), '..'); const state: Record = {}; const profiles: string[] = []; const children: ChildProcess[] = []; -const provider = process.argv.includes('--default-network') ? 'google' : 'none'; +const provider = process.argv.includes('--default-network') ? 'pagequit' : 'none'; const reversed = process.argv.includes('--reverse'); const driver = `(${installBrowserContext.toString()})(); (${crossBrowserDriver.toString()})(${JSON.stringify(provider)});`; let finish: () => void = () => {}; diff --git a/src/components/TransferPanel.vue b/src/components/TransferPanel.vue index 1eda3ea..756fb9b 100644 --- a/src/components/TransferPanel.vue +++ b/src/components/TransferPanel.vue @@ -33,7 +33,7 @@ const choosing = ref(false); const dragover = ref(false); const iceEndpoint = location.protocol === 'file:' ? '' : import.meta.env.VITE_ICE_ENDPOINT || ''; const defaultStun = location.protocol === 'file:' ? '' : import.meta.env.VITE_STUN_URL || ''; -const settings = ref({ stunChoice: defaultStun ? 'custom' : 'google', customStun: defaultStun, allowTurn: false, managedTurn: !!iceEndpoint, turnUrl: '', username: '', credential: '' }); +const settings = ref({ stunChoice: defaultStun ? 'custom' : 'pagequit', customStun: defaultStun, allowTurn: false, managedTurn: !!iceEndpoint, turnUrl: '', username: '', credential: '' }); const managedCredentials = ref(null); const canSaveToDisk = typeof window.showSaveFilePicker === 'function'; let active: Session | null = null; diff --git a/src/lib/webrtc.ts b/src/lib/webrtc.ts index af64b80..5544d1f 100644 --- a/src/lib/webrtc.ts +++ b/src/lib/webrtc.ts @@ -10,7 +10,7 @@ export interface IceOptions { } export interface NetworkSettings { - stunChoice: 'google' | 'cloudflare' | 'none' | 'custom'; + stunChoice: 'pagequit' | 'google' | 'cloudflare' | 'none' | 'custom'; customStun: string; allowTurn: boolean; managedTurn: boolean; @@ -31,6 +31,7 @@ export const CHUNK_SIZE = 16 * 1024; export const MAX_BUFFERED = 1024 * 1024; export const MAX_SIGNAL_LENGTH = 64 * 1024; export const STUN_PROVIDERS = [ + { id: 'pagequit', label: 'PageQuit', url: 'stun:stun.pagequit.net:3478' }, { id: 'google', label: 'Google', url: 'stun:stun.l.google.com:19302' }, { id: 'cloudflare', label: 'Cloudflare', url: 'stun:stun.cloudflare.com:3478' }, { id: 'none', label: 'None (direct connections only)', url: null },