Skip to content

Request: Allow binding specific interface.  #304

@Quackdoc

Description

@Quackdoc

Currently it seems rqbit will use whatever interface is the "default" on the PC. sadly this means that if I start a download while my VPN (for work) is enabled it will use that. This is less then ideal.

The other benefit is... obvious for folk who live in countries with strong laws. I did do a simple patch below which seems to work for this. for my use case at least. I'm not sure about any security concerns such as ip leaks, I presume DHT would need to be set for it's interface as well. It may also be nice to set for upnp as some people may just want to share on a single network like zerotier or tailscale, likewise I can also see this being useful for the http api.

It's worth noting that just binding to an ip address can often be insufficient as if you have multiple VPNs like I do for work and play, it is possible for VPNs to have conflicting IP addresses which can cause the user to need some really janky routing which can be fairly complex to set up for some folk

diff --git a/crates/librqbit/src/session.rs b/crates/librqbit/src/session.rs
index 6606f7a..26deefd 100644
--- a/crates/librqbit/src/session.rs
+++ b/crates/librqbit/src/session.rs
@@ -600,6 +600,7 @@ impl Session {
                     reqwest::Client::builder().proxy(proxy)
                 } else {
                     reqwest::Client::builder()
+                    .interface("MY-INTERFACE-HERE")
                 };

                 builder.build().context("error building HTTP(S) client")?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions