-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: vanilla TS web viewer on raw WebTransport #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0492c3b
refactor: replace Electron/React shell with vanilla TS web viewer
b064378
fix: decode H.264 via avcC description instead of Annex B guesswork
af28331
fix: detect access-unit boundaries from slice headers, drop pre-keyfr…
b03680b
fix: address CodeRabbit review on the web viewer
421453a
fix: read WebTransportReceiveStream directly, not through .readable
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,52 @@ | ||
| # client | ||
| Desktop App for Distance. | ||
|
|
||
| Web viewer for [Distance](https://github.com/distancedesktop/agent) — connects to | ||
| a Distance agent over raw WebTransport and decodes its H.264 stream in the | ||
| browser. | ||
|
|
||
| No Electron, no framework: vanilla TypeScript built with Vite. | ||
|
|
||
| ## Usage | ||
|
|
||
| ```bash | ||
| npm install | ||
| npm run dev # dev server on :5173 | ||
| npm run build # static bundle in dist/ | ||
| ``` | ||
|
|
||
| Serve `dist/` from any static host. WebTransport requires a secure context, so | ||
| use `https://` (or `localhost`) when serving it. | ||
|
|
||
| Add a connection with the agent's host, port (`52020` by default) and the | ||
| SHA-256 certificate fingerprint the agent prints on startup. | ||
|
|
||
| Tick **Trusted certificate** and leave the fingerprint blank only when the agent | ||
| presents a **CA-trusted** certificate — served through a reverse proxy, or run | ||
| with `--cert`/`--key` pointing at a real certificate for that hostname. That mode | ||
| omits `serverCertificateHashes` entirely and relies on normal browser PKI | ||
| validation, so a self-signed certificate supplied via `--cert`/`--key` will be | ||
| rejected. | ||
|
|
||
| For a self-signed certificate, keep the fingerprint. The agent only prints it | ||
| with `--fingerprint` when it manages its own certificate; for a custom one, | ||
| compute it from the DER bytes: | ||
|
|
||
| ```bash | ||
| openssl x509 -in cert.pem -outform der | openssl dgst -sha256 | ||
| ``` | ||
|
|
||
| ## Protocol | ||
|
|
||
| Control messages are newline-delimited JSON on one bidirectional stream; video | ||
| is raw H.264 Annex B on server-initiated unidirectional streams. See | ||
| `src/types.ts` for the message shapes, which track the agent's `src/session.go`. | ||
|
|
||
| ## Requirements | ||
|
|
||
| A browser with both WebTransport and WebCodecs: | ||
|
|
||
| | Browser | Required | | ||
| |---------|----------| | ||
| | Chrome / Edge | 97+ | | ||
| | Firefox | 114+, with WebCodecs enabled | | ||
| | Safari | 26.4+ (WebTransport); WebCodecs H.264 needs 16.4+ | | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: distancedesktop/client
Length of output: 1560
🌐 Web query:
Mozilla Firefox WebCodecs API support Firefox 130 VideoDecoder desktop release notes💡 Result:
The WebCodecs API, including the VideoDecoder interface, is officially supported in Firefox for desktop platforms starting with Firefox 130 [1][2][3]. This release enabled the API by default across all desktop platforms (Windows, macOS, and Linux), allowing web developers to have low-level control over media encoding and decoding, such as processing video frames or audio chunks [4][1][5]. While the core WebCodecs functionality for audio and video is supported, the image-related parts of the API were not included in this initial shipping milestone [4]. Additionally, while desktop support was enabled in Firefox 130, WebCodecs support for Firefox for Android remains disabled as of that release [1][5].
Citations:
🏁 Script executed:
Repository: distancedesktop/client
Length of output: 4353
Raise the Firefox minimum to Firefox 130+ for desktop.
Firefox 130 added desktop WebCodecs support, including
VideoDecoder, which this viewer requires. Firefox for Android remains unsupported.🧰 Tools
🪛 LanguageTool
[style] ~51-~51: This sentence may be long and difficult for your reader to follow. Consider inserting a period and starting a new sentence here.
Context: ...| Chrome / Edge | 97+ | | Firefox | 114+, with WebCodecs enabled | | Safari | 26.4+ (WebTransport); WebC...
(WITH_THE_SENTENCE)
🤖 Prompt for AI Agents
Source: MCP tools