Merge branch 'warp-integration' into development

This commit is contained in:
ilyaigpetrov 2021-06-26 16:07:01 +00:00
commit e1bdf654f2
2 changed files with 15 additions and 2 deletions

View File

@ -104,6 +104,13 @@
desc: 'Установите <a href="https://rebrand.ly/ac-tor">Tor</a> на свой компьютер и используйте его как прокси-сервер. <a href="https://rebrand.ly/ac-tor">ВАЖНО</a>.',
order: 5,
},
ifUseLocalWarp: {
dflt: false,
category: 'ownProxies',
label: 'использовать WARP как прокси',
desc: 'Использовать СВОЙ локальный CloudFlare WARP (<a href="https://one.one.one.one">https://one.one.one.one</a>) в качестве прокси.',
order: 5.5,
},
exceptions: {
dflt: null,
category: 'exceptions',
@ -245,6 +252,10 @@
customProxyArray = customProxyArray.filter( (pStr) => /^HTTPS\s/.test(pStr) );
}
}
if (self.ifUseLocalWarp) {
self.warpPoints = ['HTTPS localhost:40000', 'SOCKS5 localhost:40000'];
customProxyArray.push(...self.warpPoints);
}
if (self.ifUseLocalTor) {
self.torPoints = ['SOCKS5 localhost:9150', 'SOCKS5 localhost:9050'];
customProxyArray.push(...self.torPoints);

View File

@ -80,7 +80,9 @@
localhost: { host: 'localhost' },
});
privates._ipToHostObj = {};
privates._ipToHostObj = {
'127.0.0.1': { host: 'localhost' },
};
// Persisted.
const ipToHost = _state(ip2host);
@ -257,7 +259,7 @@
const hostArr = Object.keys(privates._strToHostObj)
.filter((hostStr) => hostStr !== 'localhost');
console.log('Update all:', hostArr);
const promises = hostArr.map(