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 doing the opposite). Compression be controlled with the --compress-always and --compress-never options.
-
Support for enabling cross-origin isolation mode. This sets the so-called COOP and COEP headers, which are required to enable SharedArrayBuffer and multithreading. Enable with the --cross-origin-isolation option. Note that this may impose additional restrictions on cross-origin requests.
TODO:
- ipv6 support
Installation and Usage
pip install qtwasmserver
Usage exmaples:
qtwasmserver # Start server on localhost, serve $CWD
qtwasmserver /path/to/wasm/builds # Specify web root path
qtwasmserver -p 1080 # Start server(s) on a spesific port
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 --cross-origin-isolation # Enable cross-origin 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:
- 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.
- Generate a certificate for each address you want to use. This is done automatically by this server.
The main beneifit of this appraoch is that certificates can be generated locally on demand, which can be useful when for instance when moving a development machine between home and office networks.
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
Built Distribution
File details
Details for the file qtwasmserver-0.1.0.tar.gz
.
File metadata
- Download URL: qtwasmserver-0.1.0.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.23.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c463d069d83c1567ced5347fb78e3484f9e07d0d73e5d0f5876d38fa5a349f7 |
|
MD5 | f9e4abc9fd4f169cf902916a2eebc1a4 |
|
BLAKE2b-256 | 1618a6041adb5289b002f9b207e406e8e1ca36707a9a57ef9283e63ecd62afd7 |
File details
Details for the file qtwasmserver-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: qtwasmserver-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.23.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a96bfdb18243402cd44c1c8d8a054fd2f8cb1710afb79e7ce9b5aa75d0605a75 |
|
MD5 | 05209cf997248ea56843e5776d6e7f13 |
|
BLAKE2b-256 | 1f18c34ea8a9b569b1494b3d693d4c726c70c976d95c2975cd4d71ad879ad858 |