mirror of
https://github.com/YGGverse/aquatic-crawler.git
synced 2026-04-01 01:25:36 +00:00
implement listen option, rename enable_upnp_port_forwarding to listen_upnp
This commit is contained in:
parent
a762cb59b6
commit
fbc80843c7
3 changed files with 25 additions and 8 deletions
15
src/main.rs
15
src/main.rs
|
|
@ -13,11 +13,11 @@ use config::Config;
|
|||
use index::Index;
|
||||
use librqbit::{
|
||||
AddTorrent, AddTorrentOptions, AddTorrentResponse, ByteBufOwned, ConnectionOptions,
|
||||
PeerConnectionOptions, SessionOptions, TorrentMetaV1Info,
|
||||
ListenerOptions, PeerConnectionOptions, SessionOptions, TorrentMetaV1Info,
|
||||
};
|
||||
use peers::Peers;
|
||||
use rss::Rss;
|
||||
use std::{collections::HashSet, num::NonZero, path::PathBuf, time::Duration};
|
||||
use std::{collections::HashSet, num::NonZero, path::PathBuf, str::FromStr, time::Duration};
|
||||
use torrent::Torrent;
|
||||
use trackers::Trackers;
|
||||
use url::Url;
|
||||
|
|
@ -51,6 +51,17 @@ async fn main() -> Result<()> {
|
|||
None => PathBuf::new(),
|
||||
},
|
||||
SessionOptions {
|
||||
listen: Some(match config.listen {
|
||||
Some(l) => ListenerOptions {
|
||||
listen_addr: std::net::SocketAddr::from_str(&l).unwrap(),
|
||||
enable_upnp_port_forwarding: config.listen_upnp,
|
||||
..ListenerOptions::default()
|
||||
},
|
||||
None => ListenerOptions {
|
||||
enable_upnp_port_forwarding: config.listen_upnp,
|
||||
..ListenerOptions::default()
|
||||
},
|
||||
}),
|
||||
connect: Some(ConnectionOptions {
|
||||
enable_tcp: config.enable_tcp,
|
||||
proxy_url: config.proxy_url,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue