No description
  • HTML 63.7%
  • JavaScript 36.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Philipp Harms 07ae522a84 Onshape Live VR Bridge: WebRTC glTF streaming + WebXR receiver
Firefox MV3 extension that fetches the live Onshape glTF (part studio or
assembly) and streams it P2P over a WebRTC DataChannel to a WebXR receiver
on the Meta Quest. Includes optional tab-video sharing, hand/controller
manipulation, measuring, exploded view, movable sun, Onshape selection
highlight, and a Node signaling + static server.
2026-10-13 00:47:08 +02:00
.gitignore Onshape Live VR Bridge: WebRTC glTF streaming + WebXR receiver 2026-10-13 00:47:08 +02:00
background.js Onshape Live VR Bridge: WebRTC glTF streaming + WebXR receiver 2026-10-13 00:47:08 +02:00
content.js Onshape Live VR Bridge: WebRTC glTF streaming + WebXR receiver 2026-10-13 00:47:08 +02:00
manifest.json Onshape Live VR Bridge: WebRTC glTF streaming + WebXR receiver 2026-10-13 00:47:08 +02:00
package-lock.json Onshape Live VR Bridge: WebRTC glTF streaming + WebXR receiver 2026-10-13 00:47:08 +02:00
package.json Onshape Live VR Bridge: WebRTC glTF streaming + WebXR receiver 2026-10-13 00:47:08 +02:00
README.md Onshape Live VR Bridge: WebRTC glTF streaming + WebXR receiver 2026-10-13 00:47:08 +02:00
receiver.html Onshape Live VR Bridge: WebRTC glTF streaming + WebXR receiver 2026-10-13 00:47:08 +02:00
server.js Onshape Live VR Bridge: WebRTC glTF streaming + WebXR receiver 2026-10-13 00:47:08 +02:00

Onshape Live VR Bridge

A Firefox WebExtension (Manifest V3) that streams your live Onshape 3D model into the Meta Quest browser for WebXR passthrough viewing.

  • Fetches the live 3D model from the Onshape API (/api/.../gltf) — the exact geometry of the open part studio / assembly.
  • Streams the glTF P2P over a WebRTC DataChannel to the headset, where it's rendered natively (sharp, not a compressed video).
  • The headset just opens one URL in the Quest browser (A-Frame, xr-mode-ui="XRMode: xr", immersive-ar passthrough).
 Firefox (PC)                         Node server (this repo)                Meta Quest
 ┌──────────────────────┐            ┌─────────────────────────┐           ┌───────────────────┐
 │ Onshape tab          │  ws://     │ 127.0.0.1:8080  (sender)│           │ receiver.html     │
 │  content.js (sender) │───────────▶│ signaling relay + files │◀──wss────▶│  A-Frame WebXR    │
 │   fetch .../gltf     │            │ 0.0.0.0:8443   (receiver)│  https    │  (passthrough)    │
 └──────────┬───────────┘            └─────────────────────────┘           └───────────────────┘
            │                                                                        ▲
            │                     WebRTC P2P: glTF over a DataChannel                │
            └────────────────────────────────────────────────────────────────────────┘

Why there is a server.js

A browser extension cannot bind a listening port, so it can't be the server the headset connects to. server.js is that server. It does two things:

  1. Serves receiver.html to the Quest.
  2. Relays WebRTC signaling (offer/answer/ICE) between the two peers.

It exposes two endpoints so nobody has to click through a cert warning on the PC:

Endpoint For Why
ws://127.0.0.1:8080/signal the sender (Onshape tab) loopback is a secure context — no TLS needed
https://<LAN-IP>:8443/ + wss://…/signal the Quest WebXR requires a secure context over LAN → HTTPS (self-signed)

The media itself never touches the server — it's peer-to-peer WebRTC.


1. Start the server

npm install
node server.js

You'll see something like:

=== Open this on the Meta Quest Browser ===
   https://172.28.193.50:8443/

2. Load the extension in Firefox

  1. about:debugging#/runtime/this-firefox
  2. Load Temporary Add-on… → pick manifest.json in this folder. (Temporary add-ons are removed when Firefox restarts; that's expected for dev.)

3. Stream

  1. Open the Quest Browser and go to the https://<LAN-IP>:8443/ URL first (accept the self-signed cert once — see step 4).
  2. Open your Onshape part studio / assembly tab in Firefox.
  3. Click the Onshape Live VR Bridge toolbar button → a panel appears.
  4. Confirm the signaling server field is ws://127.0.0.1:8080/signal.
  5. Click ▶ Send model to VR. The extension fetches the live glTF and streams it.

4. On the Quest

  1. Open the Quest Browser and go to the https://<LAN-IP>:8443/ URL.
  2. Accept the self-signed certificate warning (Advanced → Proceed) once.
  3. Watch the in-VR log; when it shows MODEL LOADED ✓, tap Enter VR / Passthrough.
    • Right thumbstick rotates the model, left thumbstick (up/down) scales it.

⚠️ WSL2 networking (you are on Windows 11 + WSL) — READ THIS

The IP server.js prints (e.g. 172.28.x.x) is WSL's internal NAT IP and is not reachable from the Quest by default. Two ways to fix it:

Create/edit C:\Users\<you>\.wslconfig (in Windows):

[wsl2]
networkingMode=mirrored

Then in an admin PowerShell: wsl --shutdown, and restart WSL. Now WSL shares the Windows host's IP. Point the Quest at https://<Windows-LAN-IP>:8443/ (run ipconfig in Windows to find it). Loopback is shared too, so the extension's ws://127.0.0.1:8080 keeps working.

You must also allow the port through Windows Defender Firewall (admin PowerShell):

New-NetFirewallRule -DisplayName "Onshape VR Bridge" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 8443

Option B: port-proxy the WSL IP (no mirrored mode)

In an admin PowerShell (replace <WSL_IP> with the 172.x address printed):

netsh interface portproxy add v4tov4 listenport=8443 listenaddress=0.0.0.0 connectport=8443 connectaddress=<WSL_IP>
New-NetFirewallRule -DisplayName "Onshape VR Bridge" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 8443

Then the Quest uses https://<Windows-LAN-IP>:8443/.

The PC↔WSL direction (extension → ws://127.0.0.1:8080) works out of the box — WSL2 forwards localhost from Windows automatically.


Files

File Role
manifest.json MV3 manifest (Firefox / browser_specific_settings).
background.js Toolbar click → toggles the in-page panel; stores the signaling URL.
content.js Sender. Injects the panel, fetches the glTF, is the WebRTC offerer.
receiver.html Receiver. A-Frame WebXR passthrough scene; renders the streamed glTF model + in-VR debug log.
server.js Static file server + WebRTC signaling relay (HTTP/WS loopback + HTTPS/WSS LAN).

Notes & limitations

  • Firefox for the sender, by design (Chrome MV3 blocks a background from reaching a plain-ws loopback from an https page the way this uses it, and the manifest targets gecko).
  • The Quest can use any WebXR browser; the Quest Browser is what's tested.
  • glTF auth: the model is fetched with your Onshape session cookies (credentials: "include") from the page origin, so you must be logged in. Very large assemblies can take a while or be rejected by the API; if the fetch fails, the panel shows the exact error (e.g. HTTP 404) and nothing is sent.
  • One headset at a time in this prototype (single signaling room). Multiple receivers would each need their own RTCPeerConnection on the sender.
  • The self-signed cert is regenerated on every start — that's fine for LAN dev.