Sep
15
2023

Run webgl application locally using python

Unity has new runtime tax/fee, but it doesn’t apply for webgl games!
So how about you bundle your webgl build with simple batch script that starts webserver using python.

STEPS
– Build your webgl normally
– Copy this runwebgl.bat file into your webgl build folder (next to index.html) https://gist.github.com/unitycoder/0a1014d784c6b7884b3ab96e1e13806f
– Then run runwebgl.bat and it starts webserver (*only if Python is available to run from path, and opens your index.html)


TODO
– Test if compression works? brotli/gzip

—————————


https://forum.unity.com/threads/unity-plan-pricing-and-packaging-updates.1482750/

ALTERNATIVES
– Create simple webserver using c# and include that with your webgl build
– Or include any standalone webserver.exe with your webgl build
– Node.js can spin webserver also


Leave a comment

Connect

Twitter View LinkedIn profile Youtube Github Join Discord Twitch Instagram BlueSky

UnityLauncherPro

Get UnityLauncherPRO and work faster with Unity Projects!
*free unity hub alternative

@unitycoder_com

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.