1
Fork 0
mirror of https://github.com/RGBCube/Site synced 2025-08-01 13:37:49 +00:00

Add IPv6 support

This commit is contained in:
RGBCube 2024-01-10 16:35:37 +03:00
parent 99eeb551ae
commit 90d744ac15
No known key found for this signature in database
2 changed files with 10 additions and 6 deletions

8
Cargo.lock generated
View file

@ -475,9 +475,9 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
[[package]] [[package]]
name = "h2" name = "h2"
version = "0.4.0" version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1d308f63daf4181410c242d34c11f928dcb3aa105852019e043c9d1f4e4368a" checksum = "991910e35c615d8cab86b5ab04be67e6ad24d2bf5f4f11fdbbed26da999bbeab"
dependencies = [ dependencies = [
"bytes", "bytes",
"fnv", "fnv",
@ -1191,9 +1191,9 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
[[package]] [[package]]
name = "termcolor" name = "termcolor"
version = "1.4.0" version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755"
dependencies = [ dependencies = [
"winapi-util", "winapi-util",
] ]

View file

@ -7,7 +7,11 @@ mod minify;
mod page; mod page;
mod routes; mod routes;
use std::net::SocketAddr; use std::net::{
IpAddr,
Ipv6Addr,
SocketAddr,
};
use anyhow::Context; use anyhow::Context;
use axum::Router; use axum::Router;
@ -35,7 +39,7 @@ async fn main() -> anyhow::Result<()> {
.format_timestamp(None) .format_timestamp(None)
.init(); .init();
let address = SocketAddr::from(([0, 0, 0, 0], args.port)); let address = SocketAddr::new(IpAddr::from(Ipv6Addr::UNSPECIFIED), args.port);
let router = Router::new() let router = Router::new()
.merge(routes::router()) .merge(routes::router())