Giter VIP home page Giter VIP logo

Comments (5)

slashbeast avatar slashbeast commented on June 15, 2024 1

All good, the build out of interface-option works exactly as I would expect curl --interface to work. Thanks for the feature!

from xh.

ducaale avatar ducaale commented on June 15, 2024

What value would you like to pass to --interface? from cURL docs, I see that it accepts either interface name, IP address or host name.

We can add support for --interface <ip-address> by making use of reqwests's hyper's set_local_address. However, --interface <interface-name> is yet to be supported by hyper-rs. See hyperium/hyper#3076 and seanmonstar/reqwest#1336

from xh.

slashbeast avatar slashbeast commented on June 15, 2024

I am okay with any of those. If I had option to choose I'd go with interface name, but setting the outbound local IP also works for me. iproute2 does have --json output so I can hack some script that I could use like xh --interface $(if-to-ip wg-relay4) .... that would just go over JSON from ip --json address show to figure out what local IP has the given interface, and return the IP.

The GNU wget also only supports binding to IP via --bind-address and have no smarts to specify interface instead, I think this is fully sufficient feature, though in this case perhaps --bind-address makes more sense than --interface as the switch unless you want later to add the interface selection, once those are supported by hyper bindings.

from xh.

ducaale avatar ducaale commented on June 15, 2024

I am leaning more towards mimicking cURL and only having the --interface option.

I can hack some script that I could use like xh --interface $(if-to-ip wg-relay4) .... that would just go over JSON from ip --json address show to figure out what local IP has the given interface, and return the IP.

Actually, we could let xh handle the interface to local IP mapping. Of course, this is a temporary solution since some users will sooner or later run into seanmonstar/reqwest#1336.

from xh.

ducaale avatar ducaale commented on June 15, 2024

@slashbeast I would like to know if #307 works for your use case (CI is failing due to MSRV policy which we can ignore for now)

$ cargo run -- --interface wg-relay4 https://ipinfo.io/ip

from xh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.