This doesn't make any sense to me. And I've written a Go reverse proxy server <a href="https://github.com/carlmjohnson/simple-reverse-proxy" rel="nofollow">https://github.com/carlmjohnson/simple-reverse-proxy</a> .<p>Python's SimpleHTTPServer is for when you have some directory on your computer and you want to test it locally in the browser. That's all. So, there's no reason to use GZIP or HTTP2 with a SimpleHTTPServer replacement. If you need those features, it's because you're doing things _in production_, in which case you should use Nginx, Apache, or Caddy (if you really want to use something Go-based).<p>TL;DR: If you need GZIP/HTTP2, it's not "simple."
If you have python-twisted installed, you can also use this one-liner:<p><pre><code> python -c 'from twisted.web.server import Site; from twisted.web.static import File; from twisted.internet import reactor; reactor.listenTCP(4545, Site(File("/your/static/file/directory/"))); reactor.run()'
</code></pre>
I was unable to watch HTML5 video using the `python -m SimpleHTTPServer`, but with twisted it works. Not sure why but it's somehow related to streaming content.
It's like `python3 -m http.server` but in a language that is rarely pre-installed on systems with an external program that has two external dependencies.