A blazing fast server that host Unity WebGL builds with correct headers, supporting Gzip and Brotli.
# Globally install the package
npm install -g unity-serve
unity-serve $Path
# Or one time use
npx unity-serve $Path
The server will start at http://localhost:8080 and list all WebGL directory recursively under $Path
.
- Open the corresponding link with your browser. (preferably Chrome)
- If used correct, you'll see a list of your WebGL builds.
- Click on any build's name to launch it.
If the game doesn't load, try Ctrl+Shift+R to force reload.
Settings in index.js
:
hostname
: 'localhost' by default. For public hosting, change it to '0.0.0.0'port
: 8080 by default, will increment if port occupiedenableCORS
: Whether to enable Cross-Origin Resource SharingenableWasmMultithreading
: Whether to enable WebAssembly multithreading support