本文整理匯總了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,
);
}