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
- MotionVector Effect: Object “disappears” when paused
- [GreaseMonkey] Unity Forum Fixer
- UnityHub: Make Hub application background Translucent
- Customize SpriteShapeRenderer quality (but has issues)
- Editor tool: Copy selected gameobject’s names into clipboard as rows (for Excel)
- Editor tool: Replace string in selected gameobject’s names
- UnityHub: Enable built-in Login Dialog (no more browser login/logout issues!)
- Use TikTok-TTS in Unity (with WebRequest)
- Create Scene Thumbnail Image using OnSceneSaved & OnPreviewGUI
- webgl+javascript TTS
- Using Moonsharp (LUA) + Unity Webgl
- Using 3D gameobject prefabs with Unity Tilemap + NavMesh Surface
Recent Comments
- [Asset Store] Point Cloud Viewer & Tools on
- [Asset Store] Point Cloud Viewer & Tools on
- Vector3 maths for dummies! on
- UnityHub: Make Hub application background Translucent on
- UnityHub: Make Hub application background Translucent on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- [Asset Store] Point Cloud Viewer & Tools on
[…] Source link title_words_as_hashtags […]