本文整理汇总了TypeScript中@lifter/networksetup-proxy.NetworksetupProxy类的典型用法代码示例。如果您正苦于以下问题:TypeScript NetworksetupProxy类的具体用法?TypeScript NetworksetupProxy怎么用?TypeScript NetworksetupProxy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了NetworksetupProxy类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: reloadAutoProxyUrl
async reloadAutoProxyUrl(networksetupProxy: NetworksetupProxy) {
if (!this.enabled) {
return;
}
await networksetupProxy.setautoproxystate(this.serviceName, "off");
await networksetupProxy.setautoproxystate(this.serviceName, "on");
}
示例2: disableProxy
async disableProxy(networksetupProxy: NetworksetupProxy) {
if (!(await this.isProxing())) return;
await Promise.all([
networksetupProxy.setwebproxystate(this.serviceName, "off"),
networksetupProxy.setsecurewebproxystate(this.serviceName, "off"),
]);
}
示例3: enableProxy
async enableProxy(networksetupProxy: NetworksetupProxy) {
if (await this.isProxing()) return;
await Promise.all([
networksetupProxy.setwebproxy(
this.serviceName,
NETWORK_HOST_NAME,
String(PROXY_PORT),
),
networksetupProxy.setsecurewebproxy(
this.serviceName,
NETWORK_HOST_NAME,
String(PROXY_PORT),
),
]);
}
示例4: setAutoProxyUrl
async setAutoProxyUrl(networksetupProxy: NetworksetupProxy) {
if (!this.enabled) {
return;
}
await networksetupProxy.setautoproxyurl(
this.serviceName,
String(PROXY_PORT),
);
}
示例5: setProxyBypassDomains
async setProxyBypassDomains(
networksetupProxy: NetworksetupProxy,
proxyBypassDomainEntities: ProxyBypassDomainEntity[],
): Promise<IOResult | undefined> {
if (!(await this.isProxing())) return undefined;
let proxyBypassDomains = proxyBypassDomainEntities.map(
entity => entity.name,
);
let domain = await getProxyByPassDomains(this);
let domains = domain.split(/\n/).concat(proxyBypassDomains);
let uniqueDomains = Array.from(new Set(domains));
return await networksetupProxy.setproxybypassdomains(
this.serviceName,
uniqueDomains,
);
}