mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-13 06:05:34 +08:00
fix(proxies): disconnect after proxy is changed
This commit is contained in:
parent
e4021bbe47
commit
a8cb75f29d
@ -82,6 +82,12 @@ export const useProxies = () => {
|
|||||||
const proxyGroupList = proxies().slice()
|
const proxyGroupList = proxies().slice()
|
||||||
const proxyGroup = proxyGroupList.find((i) => i.name === proxy.name)!
|
const proxyGroup = proxyGroupList.find((i) => i.name === proxy.name)!
|
||||||
|
|
||||||
|
await request.put(`proxies/${proxy.name}`, {
|
||||||
|
body: JSON.stringify({
|
||||||
|
name: proxyName,
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
|
||||||
if (autoCloseConns()) {
|
if (autoCloseConns()) {
|
||||||
activeConnections().forEach(({ id, chains }) => {
|
activeConnections().forEach(({ id, chains }) => {
|
||||||
if (chains.includes(proxy.name)) {
|
if (chains.includes(proxy.name)) {
|
||||||
@ -90,14 +96,7 @@ export const useProxies = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
await request.put(`proxies/${proxy.name}`, {
|
|
||||||
body: JSON.stringify({
|
|
||||||
name: proxyName,
|
|
||||||
}),
|
|
||||||
})
|
|
||||||
|
|
||||||
proxyGroup.now = proxyName
|
proxyGroup.now = proxyName
|
||||||
|
|
||||||
setProxies(proxyGroupList)
|
setProxies(proxyGroupList)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user