Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow binding to a configurable address. #85

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions default_config.yaml
@@ -1,5 +1,6 @@
---
# The TCP port which the daemon listens on.
host: "::"
port: 443
# Directory to www pages. Can be changed in order to host a custom website.
www: /srv/bmcd/www/
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Expand Up @@ -97,7 +97,7 @@ async fn main() -> anyhow::Result<()> {
// Serve a static tree of files of the web UI. Must be the last item.
.service(Files::new("/", &config.www).index_file("index.html"))
})
.bind_openssl(("::", config.port), tls)?
.bind_openssl((config.host, config.port), tls)?
.keep_alive(KeepAlive::Os)
.workers(2)
.run();
Expand All @@ -112,7 +112,7 @@ async fn main() -> anyhow::Result<()> {
.configure(info_config)
.default_service(web::route().to(redirect))
})
.bind(("::", HTTP_PORT))?
.bind((config.host, HTTP_PORT))?
.run(),
);
}
Expand Down