未验证 提交 5c604952 编写于 作者: O openharmony_ci 提交者: Gitee

!19626 网卡代理API说明补充

Merge pull request !19626 from 徐杰/pr_yafei_0613
# @ohos.net.ethernet (以太网连接管理)
以太网连接管理主要提供有线网络能力,提供设置有线网络的IP地址,子网掩码,网关,DNS等信息
以太网连接管理主要提供有线网络能力,提供设置有线网络的IP地址,子网掩码,网关,DNS,代理等信息
> **说明:**
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
......@@ -55,7 +55,12 @@ ethernet.setIfaceConfig("eth0", {
route: "192.168.xx.xxx",
gateway: "192.168.xx.xxx",
netMask: "255.255.255.0",
dnsServers: "1.1.1.1"
dnsServers: "1.1.1.1",
httpProxy: {
host: "180.89.xx.xx",
port: 8080,
exclusionList: {"example.com","192.168.0.1"}
}
}, (error) => {
if (error) {
console.log("setIfaceConfig callback error = " + JSON.stringify(error));
......@@ -114,7 +119,12 @@ ethernet.setIfaceConfig("eth0", {
route: "192.168.xx.xxx",
gateway: "192.168.xx.xxx",
netMask: "255.255.255.0",
dnsServers: "1.1.1.1"
dnsServers: "1.1.1.1",
httpProxy: {
host: "180.89.xx.xx",
port: 8080,
exclusionList: {"example.com","192.168.0.1"}
}
}).then(() => {
console.log("setIfaceConfig promise ok ");
}).catch(error => {
......@@ -476,6 +486,7 @@ ethernet.off('interfaceStateChange');
| gateway | string | 是 | 以太网连接配置网关信息,地址值范围0-255.0-255.0-255.0-255(DHCP模式无需配置)。 |
| netMask | string | 是 | 以太网连接配置子网掩码,地址值范围0-255.0-255.0-255.0-255(DHCP模式无需配置)。 |
| dnsServers | string | 是 | 以太网连接配置dns服务地址,地址值范围0-255.0-255.0-255.0-255(DHCP模式无需配置)多地址间用“,”隔开。 |
| httpProxy<sup>10+</sup> | [HttpProxy](js-apis-net-connection.md#httpproxy) | 否 | 以太网连接代理配置信息,默认情况下不配置任何代理信息。 |
## IPSetMode<sup>9+</sup>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册