mirror of
https://github.com/YGGverse/aquatic-crawler.git
synced 2026-03-31 17:15:35 +00:00
update listener init
This commit is contained in:
parent
3014db81e7
commit
fc27f46cdf
1 changed files with 10 additions and 8 deletions
18
src/main.rs
18
src/main.rs
|
|
@ -51,17 +51,19 @@ async fn main() -> Result<()> {
|
||||||
None => PathBuf::new(),
|
None => PathBuf::new(),
|
||||||
},
|
},
|
||||||
SessionOptions {
|
SessionOptions {
|
||||||
listen: Some(match config.listen {
|
listen: match config.listen {
|
||||||
Some(l) => ListenerOptions {
|
Some(l) => Some(ListenerOptions {
|
||||||
listen_addr: std::net::SocketAddr::from_str(&l)?,
|
listen_addr: std::net::SocketAddr::from_str(&l)?,
|
||||||
enable_upnp_port_forwarding: config.listen_upnp,
|
enable_upnp_port_forwarding: config.listen_upnp,
|
||||||
..ListenerOptions::default()
|
..ListenerOptions::default()
|
||||||
},
|
}),
|
||||||
None => ListenerOptions {
|
None => {
|
||||||
enable_upnp_port_forwarding: config.listen_upnp,
|
if config.listen_upnp {
|
||||||
..ListenerOptions::default()
|
panic!("`--listen` argument is required!")
|
||||||
},
|
}
|
||||||
}),
|
None
|
||||||
|
}
|
||||||
|
},
|
||||||
connect: Some(ConnectionOptions {
|
connect: Some(ConnectionOptions {
|
||||||
enable_tcp: config.enable_tcp,
|
enable_tcp: config.enable_tcp,
|
||||||
proxy_url: config.proxy_url,
|
proxy_url: config.proxy_url,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue