Skip to content

maoyeedy/unity-serve-cli

Repository files navigation

Unity Serve

Unity Serve

Screenshot

A blazing fast server that host Unity WebGL builds with correct headers, supporting Gzip and Brotli.

Installation

# 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.

Play the builds

  1. Open the corresponding link with your browser. (preferably Chrome)
  2. If used correct, you'll see a list of your WebGL builds.
  3. Click on any build's name to launch it.

If the game doesn't load, try Ctrl+Shift+R to force reload.

Development Options

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 occupied
  • enableCORS: Whether to enable Cross-Origin Resource Sharing
  • enableWasmMultithreading: Whether to enable WebAssembly multithreading support

References

About

Node server hosting Unity WebGL builds. Supports Gzip and Brotli.

Topics

Resources

License

Stars

Watchers

Forks