rust-web-server 17.23.0

Static file web server and HTTP toolkit written in Rust. Supports HTTP/3, HTTP/2, and HTTP/1.1. HTTP/3 and HTTP/2 require a TLS certificate; without one the server falls back to plain HTTP/1.1 automatically.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
ip = '127.0.0.1'
port = 7888
thread_count = 200
request-allocation-size-in-bytes = 12000 # In bytes, how much memory to allocate for each request

# TLS certificate and private key (PEM format). Required for HTTPS and HTTP/2.
# Build with --features http2 to enable TLS support.
# tls_cert_file = '/path/to/cert.pem'
# tls_key_file  = '/path/to/key.pem'

[cors]
allow_all = false # true will allow all CORS requests and you can omit configuring cors properties below
allow_origins = ["https://foo.example", "https://bar.example"] # list of allowed origins, this setting won't apply if cors allow_all set to true
allow_methods = ["GET", "DELETE", "PUT", "PATCH"] # list of allowed methods, this setting won't apply if cors allow_all set to true
allow_headers = ["content-type", "x-custom-header"] # list of allowed request headers, in lowercase, this setting won't apply if cors allow_all set to true
allow_credentials = true # if set to true, will allow to transmit credentials via CORS requests, this setting won't apply if cors allow_all set to true
expose_headers = ["content-type", "x-custom-header"] # list of allowed response headers, in lowercase, this setting won't apply if cors allow_all set to true
max_age = "86400" # in seconds, time to cache in browser CORS information, 86400s = 1 day; this setting won't apply if cors allow_all set to true