web

command
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

devserver — small static file server with the COOP / COEP / CORP headers that Chrome and Firefox require before they expose `SharedArrayBuffer` and `Atomics.wait` to the page. The js/wasm runtime needs both for synchronous send/recv across SharedWorker boundaries.

Usage (called from `make serve/js`):

go run ./cmd/web -dir build/web -addr :8080

On `:8080` it serves the directory tree rooted at `dir`, returning `index.html` for `/`. Every response carries:

Cross-Origin-Opener-Policy:    same-origin
Cross-Origin-Embedder-Policy:  require-corp
Cross-Origin-Resource-Policy:  same-origin

which puts the page in a "cross-origin isolated" context.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL