【问题标题】:how to route client HTTP requests over multiple NIC with libcurl如何使用 libcurl 通过多个 NIC 路由客户端 HTTP 请求
【发布时间】:2014-10-11 02:07:53
【问题描述】:

在 Ubuntu 机器上,我想知道是否有办法通过多个网络接口卡 (NIC) 将特定的 HTTP 请求路由到同一台服务器 - 比如说视频提供商。 p>

我听说过link bonding,但这似乎超出了应用代码的控制范围。 libcurl 可以用来执行这个任务吗?

我想我可以检查系统配置以检测多个网卡,但是如何翻译地址以便从特定接口读取?

【问题讨论】:

    标签: http ubuntu libcurl nic


    【解决方案1】:

    通常,传出接口取决于您的路由表。

    Curl 支持selecting the outgoing interface

    --interface <name>
    
    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 http://www.netscape.com/
    
    If this option is used several times, the last one will be used. 
    

    如果你想为同一个操作使用多个接口(就像你提到的文章中的那样),你需要包ifenslave-2.6。谷歌列出了许多如何使用它的教程。

    【讨论】:

      猜你喜欢
      • 2013-06-12
      • 2023-01-13
      • 1970-01-01
      • 2012-07-30
      • 2015-04-26
      • 2021-05-07
      • 1970-01-01
      • 2011-08-30
      • 2013-04-06
      相关资源
      最近更新 更多