update readme and config creating if does not exists

This commit is contained in:
MeexReay 2024-09-14 01:17:40 +03:00
parent 338991b9c1
commit c30cf3fbe9
3 changed files with 23 additions and 14 deletions

View File

@ -11,20 +11,23 @@ Features:
Default `conf.yml`:
```yml
http_host: localhost:80
https_host: localhost:443
http_host: localhost:80 # Http server host
https_host: localhost:443 # Https server host
sites:
# - domain: example.com # Domain with SSL
# host: localhost:8080
# ssl_cert: "/path/to/public/certificate.txt"
# ssl_key: "/path/to/private/key.txt"
# host: localhost:8080 # Http server host
# ssl_cert: "/path/to/public/certificate.txt" # Ssl public certificate file
# ssl_key: "/path/to/private/key.txt" # Ssl private key file
# support_keep_alive: true # Does server supports keep-alive connections
# - domain: sub.example.com # Domain with no SSL
# host: localhost:8081
# host: localhost:8081 # Http server host
# support_keep_alive: true # Does server supports keep-alive connections
- domain: localhost
host: localhost:8080
support_keep_alive: false
```
Rust features:

View File

@ -1,16 +1,16 @@
http_host: localhost:80
https_host: localhost:443
http_host: localhost:80 # Http server host
https_host: localhost:443 # Https server host
sites:
# - domain: example.com # Domain with SSL
# host: localhost:8080
# ssl_cert: "/path/to/public/certificate.txt"
# ssl_key: "/path/to/private/key.txt"
# support_keep_alive: true
# host: localhost:8080 # Http server host
# ssl_cert: "/path/to/public/certificate.txt" # Ssl public certificate file
# ssl_key: "/path/to/private/key.txt" # Ssl private key file
# support_keep_alive: true # Does server supports keep-alive connections
# - domain: sub.example.com # Domain with no SSL
# host: localhost:8081
# support_keep_alive: true
# host: localhost:8081 # Http server host
# support_keep_alive: true # Does server supports keep-alive connections
- domain: localhost
host: localhost:8080

View File

@ -1,8 +1,14 @@
use std::{fs, path::Path};
use flowgate::{Config, FlowgateServer};
fn main() {
colog::init();
if !Path::new("conf.yml").exists() {
let _ = fs::write("conf.yml", include_bytes!("../conf.yml"));
}
let config = Config::parse("conf.yml").unwrap();
let server = FlowgateServer::new(config);