R in the browser with webR: console, editor tabs, file browser, plot and help viewers. DataSHIELD client packages (DSI, DSOpal) can be installed and connect to public Opal servers.
Live: https://www.obiba.org/webDS/
- Cross-origin isolation: webR needs
SharedArrayBufferfor interrupt (Ctrl+C) andreadline(), so pages must be served withCross-Origin-Opener-Policy: same-originandCross-Origin-Embedder-Policy: require-corp. The dev server sends them (quasar.config.ts). On static hosts that cannot (GitHub Pages),public/coi-serviceworker.jsadds them; the page reloads once on first visit. - GitHub Pages:
.github/workflows/pages.ymlbuilds and deploys on push tomaster.PUBLIC_PATHsets the base path (/<repo>/). - webR assets and packages are loaded from the webR CDN (
webr.r-wasm.org,repo.r-wasm.org). - HTTP from R (curl/httr, used by opalr): webR tunnels TCP through a WebSocket relay run by r-universe (
ws.r-universe.dev). TLS is end to end, but only servers reachable from the internet work. httr's connect timeout is raised to 60s (src/stores/init.R); the relay appears to cap connections at about 30s. - Fetch transport (prototype, ~10x faster):
options(webds.fetch = "<opal host>")sends httr requests to that host from the browser instead of through the relay. The Opal server must support theX-Opal-Sessionheader and allow CORS from the page origin (opal branchfeat/session-header);dev/opal-cors-proxy.pysimulates that in front of an unpatched Opal. - Files live in the in-memory webR file system and are lost on reload: download what you want to keep.
npm installnpm run devnpm run build