diff --git a/README.md b/README.md index 8c3890d..bd2fc78 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/conf.yml b/conf.yml index 49a92a3..6563d66 100644 --- a/conf.yml +++ b/conf.yml @@ -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 diff --git a/src/main.rs b/src/main.rs index 899b681..d895e99 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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);