Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能不能指定网卡? #5

Closed
keguo1119 opened this issue Mar 24, 2019 · 4 comments
Closed

能不能指定网卡? #5

keguo1119 opened this issue Mar 24, 2019 · 4 comments

Comments

@keguo1119
Copy link

socket 编程可以指定网卡,我有eth0, eth1 两个网卡,想要指定eth1, 此sdk 上层函数有没有指定网口的功能

@huiguangjun
Copy link
Collaborator

sdk 封装了 libcurl 作为其 http的请求实现。
libcurl 提供了API 可以 指定interface。 后续版本会把这个接口开放出来。

你可以参考 ClientConfiguration.caPath 的 方式 在现在的版本上自行添加。 对应到的libcurl 的接口 为
curl_easy_setopt(curl, CURLOPT_INTERFACE, "eth0");
具体 详见 https://curl.haxx.se/libcurl/c/CURLOPT_INTERFACE.html

@huiguangjun
Copy link
Collaborator

该功能已经提交到 dev-1903分支上。
可以通过 ClientConfiguration.networkInterface 设置。

@keguo1119
Copy link
Author

还想问下,我当前用的是 C 的SDK, C 这个选项是不是没有开启

@huiguangjun
Copy link
Collaborator

c sdk 没有提供这个选项。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants