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
- LudumDare59 : Signal
- Unity Editor: Tree Generator
- Leaf/Foliage Generator Tools (Runs in Browser)
- Testing Unity AI Beta
- Ways to Support UnityCoder Development
- Using UI Slider to Create 5-Star Rating Element
- Game Music Library For Unity (editor plugin)
- Fontastic : Easily Test Fonts in Unity Editor!
- GeoTiff Importer & Terrain Generator for Unity
- Create Baked DropShadow for UI images
- .JP2 Ortho Image Converter to PNG/JPG/TIFF
- Convert LAS/LAZ/PLY pointclouds to GLTF (GLB) Point Meshes (standalone converter)
Recent Comments
- on Sprite Sheet Flip Book Shader
- on Sprite Sheet Flip Book Shader
- on [Asset Store] PolygonCollider2D Optimizer
- on Trajectory Test Scene 2.0
- on Vector3 maths for dummies!
- on UnityHub 3.6.0: Remove Version Control & Cloud Dashboard columns
- on Using RenderDoc with Unity (graphics debugger)
- on UI Scroll View automatic Content height
Coin:
CUgDSbRqFcAumDSAcdKDvuXsw26VdkJe8C8WGUQHBAGS
An article by












[…] Source link title_words_as_hashtags […]