aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-12-07 15:20:45 +0100
committerAlex Auvolat <alex@adnab.me>2021-12-07 15:20:45 +0100
commitcd7e5ad034b75d659d4d87a752ab7b11cf75de12 (patch)
tree32773f9758b33188402e137d435bdd61ce01b280 /src/main.rs
parent5535c4951a832d65755afa53822a36e96681320f (diff)
downloadtricot-cd7e5ad034b75d659d4d87a752ab7b11cf75de12.tar.gz
tricot-cd7e5ad034b75d659d4d87a752ab7b11cf75de12.zip
Got a reverse proxy
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index d7f1e24..df0845d 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -5,11 +5,13 @@ mod cert;
mod cert_store;
mod consul;
mod http;
+mod https;
mod proxy_config;
+mod reverse_proxy;
use log::*;
-#[tokio::main(flavor = "multi_thread")]
+#[tokio::main(flavor = "multi_thread", worker_threads = 10)]
async fn main() {
if std::env::var("RUST_LOG").is_err() {
std::env::set_var("RUST_LOG", "tricot=debug")
@@ -28,6 +30,10 @@ async fn main() {
);
tokio::spawn(http::serve_http(consul.clone()));
+ tokio::spawn(https::serve_https(
+ cert_store.clone(),
+ rx_proxy_config.clone(),
+ ));
while rx_proxy_config.changed().await.is_ok() {
info!("Proxy config: {:#?}", *rx_proxy_config.borrow());