fix: 修复proxy优选的bug
parent
0cfb32d4a7
commit
f52b2e1249
|
@ -93,15 +93,16 @@
|
||||||
lodash "^4.17.19"
|
lodash "^4.17.19"
|
||||||
to-fast-properties "^2.0.0"
|
to-fast-properties "^2.0.0"
|
||||||
|
|
||||||
"@docmirror/mitmproxy@^1.1.0":
|
"@docmirror/mitmproxy@^1.2.0":
|
||||||
version "1.1.0"
|
version "1.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/@docmirror/mitmproxy/-/mitmproxy-1.1.0.tgz#d2dfa4c8047306c40105e0673365fdb4182be39b"
|
resolved "https://registry.yarnpkg.com/@docmirror/mitmproxy/-/mitmproxy-1.2.0.tgz#ab9910031272d8e16fe0e38d434f7b42971bc74e"
|
||||||
integrity sha512-KgNQ24o18G3Gnw9F9EkKKIKuEf3EnHh2uASMs72HvmuLobZo+D+0L+lL2xYPp+w5t8aXt0bgQeK8lRcz2C6wWw==
|
integrity sha512-DlzquSNVZOC/p5GwAdDwSiI4KCb3HlUY4A44pGGOBehsNThBoRU8ESKJjbyay9ah4RPSAWTSVYgMEiPZctR+wg==
|
||||||
dependencies:
|
dependencies:
|
||||||
agentkeepalive "^2.1.1"
|
agentkeepalive "^2.1.1"
|
||||||
child_process "^1.0.2"
|
child_process "^1.0.2"
|
||||||
colors "^1.1.2"
|
colors "^1.1.2"
|
||||||
commander "^2.9.0"
|
commander "^2.9.0"
|
||||||
|
crypto-js "^4.0.0"
|
||||||
debug "^4.1.1"
|
debug "^4.1.1"
|
||||||
dns-over-http "^0.2.0"
|
dns-over-http "^0.2.0"
|
||||||
dns-over-tls "^0.0.8"
|
dns-over-tls "^0.0.8"
|
||||||
|
@ -1199,6 +1200,11 @@ crypto-browserify@^3.11.0:
|
||||||
randombytes "^2.0.0"
|
randombytes "^2.0.0"
|
||||||
randomfill "^1.0.3"
|
randomfill "^1.0.3"
|
||||||
|
|
||||||
|
crypto-js@^4.0.0:
|
||||||
|
version "4.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.0.0.tgz#2904ab2677a9d042856a2ea2ef80de92e4a36dcc"
|
||||||
|
integrity sha512-bzHZN8Pn+gS7DQA6n+iUmBfl0hO5DJq++QP3U6uTucDtk/0iGpXd/Gg7CGR0p8tJhofJyaKoWBuJI4eAO00BBg==
|
||||||
|
|
||||||
cyclist@^1.0.1:
|
cyclist@^1.0.1:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.npm.taobao.org/cyclist/download/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9"
|
resolved "https://registry.npm.taobao.org/cyclist/download/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9"
|
||||||
|
|
|
@ -901,12 +901,12 @@
|
||||||
ajv "^6.12.0"
|
ajv "^6.12.0"
|
||||||
ajv-keywords "^3.4.1"
|
ajv-keywords "^3.4.1"
|
||||||
|
|
||||||
"@docmirror/dev-sidecar@^1.1.0":
|
"@docmirror/dev-sidecar@^1.2.0":
|
||||||
version "1.1.0"
|
version "1.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/@docmirror/dev-sidecar/-/dev-sidecar-1.1.0.tgz#a77fbbacceedd62202aea581712b13595629756f"
|
resolved "https://registry.yarnpkg.com/@docmirror/dev-sidecar/-/dev-sidecar-1.2.0.tgz#2320c31f786afd495b8e12557bea396cb96e0985"
|
||||||
integrity sha512-Amh8m7nArLUvDL7QAfNV4rTaZIOOyS4/DY4+9h/1B9RXRFJ4oGePcBkH6QXO3p0msoutu87BtYXFTl0qvY4vQQ==
|
integrity sha512-i96YlPjQtrrAgDW52YOpuVFmQDl1A0Nx3x6/riv2yKVN4nGqAugdJvcAuhNi7BDrJfdLyls2jI35uzN5+bpYfQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@docmirror/mitmproxy" "^1.1.0"
|
"@docmirror/mitmproxy" "^1.2.0"
|
||||||
agentkeepalive "^2.1.1"
|
agentkeepalive "^2.1.1"
|
||||||
charset "^1.0.0"
|
charset "^1.0.0"
|
||||||
child_process "^1.0.2"
|
child_process "^1.0.2"
|
||||||
|
@ -920,6 +920,7 @@
|
||||||
jschardet "^1.4.1"
|
jschardet "^1.4.1"
|
||||||
json5 "^2.1.3"
|
json5 "^2.1.3"
|
||||||
lodash "^4.7.0"
|
lodash "^4.7.0"
|
||||||
|
log4js "^6.3.0"
|
||||||
lru-cache "^6.0.0"
|
lru-cache "^6.0.0"
|
||||||
mkdirp "^0.5.1"
|
mkdirp "^0.5.1"
|
||||||
node-cmd "^3.0.0"
|
node-cmd "^3.0.0"
|
||||||
|
@ -932,15 +933,16 @@
|
||||||
validator "^13.1.17"
|
validator "^13.1.17"
|
||||||
winreg "^1.2.4"
|
winreg "^1.2.4"
|
||||||
|
|
||||||
"@docmirror/mitmproxy@^1.1.0":
|
"@docmirror/mitmproxy@^1.2.0":
|
||||||
version "1.1.0"
|
version "1.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/@docmirror/mitmproxy/-/mitmproxy-1.1.0.tgz#d2dfa4c8047306c40105e0673365fdb4182be39b"
|
resolved "https://registry.yarnpkg.com/@docmirror/mitmproxy/-/mitmproxy-1.2.0.tgz#ab9910031272d8e16fe0e38d434f7b42971bc74e"
|
||||||
integrity sha512-KgNQ24o18G3Gnw9F9EkKKIKuEf3EnHh2uASMs72HvmuLobZo+D+0L+lL2xYPp+w5t8aXt0bgQeK8lRcz2C6wWw==
|
integrity sha512-DlzquSNVZOC/p5GwAdDwSiI4KCb3HlUY4A44pGGOBehsNThBoRU8ESKJjbyay9ah4RPSAWTSVYgMEiPZctR+wg==
|
||||||
dependencies:
|
dependencies:
|
||||||
agentkeepalive "^2.1.1"
|
agentkeepalive "^2.1.1"
|
||||||
child_process "^1.0.2"
|
child_process "^1.0.2"
|
||||||
colors "^1.1.2"
|
colors "^1.1.2"
|
||||||
commander "^2.9.0"
|
commander "^2.9.0"
|
||||||
|
crypto-js "^4.0.0"
|
||||||
debug "^4.1.1"
|
debug "^4.1.1"
|
||||||
dns-over-http "^0.2.0"
|
dns-over-http "^0.2.0"
|
||||||
dns-over-tls "^0.0.8"
|
dns-over-tls "^0.0.8"
|
||||||
|
@ -3729,6 +3731,11 @@ crypto-browserify@^3.11.0:
|
||||||
randombytes "^2.0.0"
|
randombytes "^2.0.0"
|
||||||
randomfill "^1.0.3"
|
randomfill "^1.0.3"
|
||||||
|
|
||||||
|
crypto-js@^4.0.0:
|
||||||
|
version "4.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.0.0.tgz#2904ab2677a9d042856a2ea2ef80de92e4a36dcc"
|
||||||
|
integrity sha512-bzHZN8Pn+gS7DQA6n+iUmBfl0hO5DJq++QP3U6uTucDtk/0iGpXd/Gg7CGR0p8tJhofJyaKoWBuJI4eAO00BBg==
|
||||||
|
|
||||||
crypto-random-string@^2.0.0:
|
crypto-random-string@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.npm.taobao.org/crypto-random-string/download/crypto-random-string-2.0.0.tgz?cache=0&sync_timestamp=1599139352103&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcrypto-random-string%2Fdownload%2Fcrypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5"
|
resolved "https://registry.npm.taobao.org/crypto-random-string/download/crypto-random-string-2.0.0.tgz?cache=0&sync_timestamp=1599139352103&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcrypto-random-string%2Fdownload%2Fcrypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5"
|
||||||
|
|
|
@ -4,7 +4,7 @@ module.exports = {
|
||||||
const { rOptions, log, RequestCounter } = context
|
const { rOptions, log, RequestCounter } = context
|
||||||
|
|
||||||
let proxyConf = interceptOpt.proxy
|
let proxyConf = interceptOpt.proxy
|
||||||
if (RequestCounter) {
|
if (RequestCounter && interceptOpt.backup) {
|
||||||
// 优选逻辑
|
// 优选逻辑
|
||||||
const backup = [proxyConf]
|
const backup = [proxyConf]
|
||||||
if (interceptOpt.backup) {
|
if (interceptOpt.backup) {
|
||||||
|
@ -12,7 +12,6 @@ module.exports = {
|
||||||
backup.push(bk)
|
backup.push(bk)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
backup.push(rOptions.hostname)
|
|
||||||
|
|
||||||
const key = interceptOpt.key
|
const key = interceptOpt.key
|
||||||
const count = RequestCounter.getOrCreate(key, backup)
|
const count = RequestCounter.getOrCreate(key, backup)
|
||||||
|
|
Loading…
Reference in New Issue