作者热门文章
- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
如果我有不同的网络连接方式,例如 wifi、我的 android 手机中的手机数据,有什么方法可以告诉 cURL 在连接到服务器时使用特定接口(interface),而不使用任何其他接口(interface)(如果可用)。我只想使用 wifi 连接,不想使用手机数据。
最佳答案
使用 --interface 选项。来自 curl 手册页:
--interface
Perform an operation using a specified interface. You can enter interface name, IP address or host name. An example could look like:
curl --interface eth0:1 https://www.example.com/
If this option is used several times, the last one will be used.
关于android - cURL-有没有办法强制 curl 使用特定的网络接口(interface),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40542363/
我是一名优秀的程序员,十分优秀!