mirror of
https://github.com/YGGverse/aquatic-crawler.git
synced 2026-03-31 17:15:35 +00:00
implement bind option
This commit is contained in:
parent
3f549e2077
commit
4646500b66
3 changed files with 14 additions and 0 deletions
|
|
@ -94,9 +94,15 @@ aquatic-crawler --infohash /path/to/info-hash-ipv4.bin\
|
||||||
--enable-tcp
|
--enable-tcp
|
||||||
Enable TCP connection
|
Enable TCP connection
|
||||||
|
|
||||||
|
--bind <BIND>
|
||||||
|
Bind resolver session on specified device name (`tun0`, `mycelium`, etc.)
|
||||||
|
|
||||||
--listen <LISTEN>
|
--listen <LISTEN>
|
||||||
Bind listener on specified `host:port` (`[host]:port` for IPv6)
|
Bind listener on specified `host:port` (`[host]:port` for IPv6)
|
||||||
|
|
||||||
|
* this option is useful only for binding the data exchange service,
|
||||||
|
to restrict the outgoing connections for torrent resolver, use `bind` option instead
|
||||||
|
|
||||||
--listen-upnp
|
--listen-upnp
|
||||||
Enable UPnP forwarding
|
Enable UPnP forwarding
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,14 @@ pub struct Config {
|
||||||
#[arg(long, default_value_t = false)]
|
#[arg(long, default_value_t = false)]
|
||||||
pub enable_tcp: bool,
|
pub enable_tcp: bool,
|
||||||
|
|
||||||
|
/// Bind resolver session on specified device name (`tun0`, `mycelium`, etc.)
|
||||||
|
#[arg(long)]
|
||||||
|
pub bind: Option<String>,
|
||||||
|
|
||||||
/// Bind listener on specified `host:port` (`[host]:port` for IPv6)
|
/// Bind listener on specified `host:port` (`[host]:port` for IPv6)
|
||||||
|
///
|
||||||
|
/// * this option is useful only for binding the data exchange service,
|
||||||
|
/// to restrict the outgoing connections for torrent resolver, use `bind` option instead
|
||||||
#[arg(long)]
|
#[arg(long)]
|
||||||
pub listen: Option<String>,
|
pub listen: Option<String>,
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ async fn main() -> Result<()> {
|
||||||
None => PathBuf::new(),
|
None => PathBuf::new(),
|
||||||
},
|
},
|
||||||
SessionOptions {
|
SessionOptions {
|
||||||
|
bind_device_name: config.bind,
|
||||||
listen: match config.listen {
|
listen: match config.listen {
|
||||||
Some(l) => Some(ListenerOptions {
|
Some(l) => Some(ListenerOptions {
|
||||||
listen_addr: std::net::SocketAddr::from_str(&l)?,
|
listen_addr: std::net::SocketAddr::from_str(&l)?,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue