mirror of
https://github.com/by-sonic/tglock.git
synced 2026-08-04 07:02:41 +03:00
feat: add LAN mode - bind to 0.0.0.0 for sharing proxy across local network
Made-with: Cursor
This commit is contained in:
+3
-2
@@ -29,8 +29,9 @@ impl Stats {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn run(stats: Arc<Stats>) -> Result<(), String> {
|
||||
let addr = format!("127.0.0.1:{}", PORT);
|
||||
pub async fn run(stats: Arc<Stats>, lan: bool) -> Result<(), String> {
|
||||
let host = if lan { "0.0.0.0" } else { "127.0.0.1" };
|
||||
let addr = format!("{}:{}", host, PORT);
|
||||
let listener = TcpListener::bind(&addr)
|
||||
.await
|
||||
.map_err(|e| format!("Port {} busy: {}", PORT, e))?;
|
||||
|
||||
Reference in New Issue
Block a user