11
2021
Run WebGL server manually
When making webgl builds, you cannot open generated index.html file directly inside the build folder (without webserver), and if you make Build & Run, and then close the browser tab, you need to do build & run again to view it later.
Run webserver from commandline:"C:/Program Files/Unity2019_4/Editor/Data/MonoBleedingEdge/bin/mono.exe" "C:/Program Files/Unity2019_4/Editor/Data/PlaybackEngines/WebGLSupport/BuildTools/SimpleWebServer.exe" "X:/YourFolder/YourProject/Builds" 60606
* Note the port number as a parameter, other arguments are:
“SimpleWebServer.exe source_directory [port] [pid] [<wasmencoding>]”
** You need to run SimpleWebServer.exe through mono.exe, otherwise it returns “403 forbidden”.
Using UnityLauncherPro:
Just added experimental feature to launch webgl server from project context menu (it launches SimpleWebServer.exe)

Alternatives (web servers) *but requires you to build webgl inside those server folders)
– XAMPP, XAMPP Portable, WAMPP, IIS
Alternatives part#2:
– Use ILSpy to decompile SimpleWebServer.exe (its c#), then build it yourself in VisualStudio, now that .exe works normally without needing to run it through mono.exe (and you could customize it to do more things).
Related Posts
1 Comment + Add Comment
Leave a comment
Recent posts
- Adding Real World Location to Ice Fishing Prototype
- [web tool] Image Channel Inspector : AlphaScope
- Editor Tool: Smart Recompile (don’t recompile if edit comments)
- Editor Tool: Scene Size Analyzer
- LudumDare 60: Old Tech
- uBasic Scripting Language for Unity
- GreaseMonkey+Editor Plugin: 1-Click Copy script from ChatGPT (Web) to Unity Editor (as script)
- Editor Tool: Property Watcher
- .unityignore : Hide files from Project window
- PostBuild Script to Create Single exe Standalone File
- Game Loop Designer
- Favorites in PackageManager
Recent Comments
Coin:
CUgDSbRqFcAumDSAcdKDvuXsw26VdkJe8C8WGUQHBAGS
An article by












[…] Source link title_words_as_hashtags […]