Skip to main content

Development Web Server for Qt for Webassembly

Project description

Qt for WebAssembly development server.

This server is intented to be used while developing and testing WebAssembly applications on a trusted network. It is not suitable for production use, i.e. distributing applicaitons to end users over public networks.

The server is an upgrade from the python one line server ("python -m http.server"), and offers the following features:

  • Zero-configuration / minimal configuration.

  • Support for binding to multiple addresses in addition to localhost. This is useful for e.g. testing on mobile devices on the same local network as the development machine. Address can be addded individually using the --address option. Pass the "-all" option to bind to all available addresses.

  • Support for generating https certificates using the mkcert utility. Many web features require a secure context. While "localhost" is considered a secure context (also when plain http is used), other addresses are not. Clicking through the "not secure" warnings is an option, but using a valid certificate improves flow.

  • Support for compression using brotli. By default, the server compresses when serving over a public, non-localhost address. (localhost is fast, enabling compression here usualually increases download time instead of the opposite). Compression be controlled with the --compress-always and --compress-never options.

  • Support for enabling site isolation mode. This sets the so-called COOP and COEP headers, which are required to enable SharedArrayBuffer and multithreading. Enable with the --site-isolation option. While there is little reason to not enable SharedArrayBuffer, site isolation mode also enables additional restrictions for cross origin requests, which may come as a surprise.

It also has a couple of non-features:

  • Support for starting/stopping web browsers.

  • Support for forwarding standard output to the console.

If you are looking to use features like the above, then emrun from Emscripten is a better choice.

TODO:

  • ipv6 support

Installation and Usage

pip install qtwasmserver

qtwasmserver                        # Start server on localhost, serve $CWD
qtwasmserver /path/to/wasm/builds   # Specify web root path
qtwasmserver --all-interfaces       # Start server(s) on all network interfaces
qtwasmserver -a 10.0.0.2            # Start server on specific address, in addition to localhost
qtwasmserver --site-isolation       # Enable site isolation mode for multithreading
qtwasmserver -h                     # Show help

Using mkcert

qtwasmserver can optinally use mkcert to generate https certifacates. See https://github.com/FiloSottile/mkcert for installation and getting started instructions.

The basic flow is:

  1. Gereate a certificate authority (CA), and install that on all devices and browsers. This is a one time operation. mkcert will use thuis CA to sign certificates.
  2. Generate a certificate for each address you want to use. This is done automatically by this server.

The main beneifits of this appraoch is that certificates can be freely generated if/when the network address for the server changes, for example when moving between home and office networks, and that it does not requie reqeusting certificates from a third party.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qtwasmserver-0.0.6.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

qtwasmserver-0.0.6-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file qtwasmserver-0.0.6.tar.gz.

File metadata

  • Download URL: qtwasmserver-0.0.6.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.3

File hashes

Hashes for qtwasmserver-0.0.6.tar.gz
Algorithm Hash digest
SHA256 fb8bc6ea0f01b5431c1e8183980d2bdbe2147b2869e74f103b09be0e4181d490
MD5 0987191283b70484a54228214d3a50d1
BLAKE2b-256 30194175eca2f14ff0768beb1305e38d673c5282ff9568574e196d3b9c758b3e

See more details on using hashes here.

File details

Details for the file qtwasmserver-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for qtwasmserver-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 80c22af02c1332883d48be5dbd49c6bb802fb7f43744263a4f03d9c8385ba50b
MD5 74fea5cc4f648d106bdc302b66bc8cce
BLAKE2b-256 c9c94e409f1f68efe4700dd81de7f2c0600e16ee54cc2374be506e313919c64f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page