Skip to content

Instantly share code, notes, and snippets.

@prideout
Created November 8, 2018 00:44
Show Gist options
  • Save prideout/09af26cef84eef3e06a1e3f20a499a48 to your computer and use it in GitHub Desktop.
Save prideout/09af26cef84eef3e06a1e3f20a499a48 to your computer and use it in GitHub Desktop.
Python WASM server
#!/usr/bin/env python3
import http.server
import socketserver
PORT = 8000
Handler = http.server.SimpleHTTPRequestHandler
Handler.extensions_map.update({
'.wasm': 'application/wasm',
})
socketserver.TCPServer.allow_reuse_address = True
with socketserver.TCPServer(("", PORT), Handler) as httpd:
httpd.allow_reuse_address = True
print("serving at port", PORT)
httpd.serve_forever()
@kuddai
Copy link

kuddai commented Mar 20, 2021

Thanks mate, those application/wasm errors are really annoying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment