| 1 | module veb |
| 2 | |
| 3 | import net |
| 4 | import time |
| 5 | |
| 6 | @[params] |
| 7 | pub struct SSLConnectConfig { |
| 8 | pub: |
| 9 | verify string |
| 10 | cert string |
| 11 | cert_key string |
| 12 | validate bool |
| 13 | in_memory_verification bool |
| 14 | read_timeout time.Duration |
| 15 | } |
| 16 | |
| 17 | @[params] |
| 18 | pub struct RunParams { |
| 19 | pub: |
| 20 | // use `family: .ip, host: 'localhost'` when you want it to bind only to 127.0.0.1 |
| 21 | family net.AddrFamily = .ip6 |
| 22 | host string |
| 23 | port int = default_port |
| 24 | nr_workers int = 1 |
| 25 | show_startup_message bool = true |
| 26 | timeout_in_seconds int = 30 |
| 27 | max_request_buffer_size int = 8192 |
| 28 | benchmark_page_generation bool // for the "page rendered in X ms" |
| 29 | ssl_config SSLConnectConfig |
| 30 | } |
| 31 | |
| 32 | fn run_at_with_ssl[A, X](mut _global_app A, _params RunParams) ! { |
| 33 | return error('veb HTTPS server requires net.mbedtls; -d use_openssl only avoids mbedtls for HTTP apps') |
| 34 | } |
| 35 | |