mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-08 06:19:05 +08:00
fix: correct proxy URL parsing in ProxyManager
This commit is contained in:
parent
190eea5a80
commit
386ea1e7da
@ -139,7 +139,8 @@ export class ProxyManager {
|
|||||||
setGlobalProxy() {
|
setGlobalProxy() {
|
||||||
const proxyUrl = this.proxyUrl
|
const proxyUrl = this.proxyUrl
|
||||||
if (proxyUrl) {
|
if (proxyUrl) {
|
||||||
const [protocol, host, port] = proxyUrl.split(':')
|
const [protocol, address] = proxyUrl.split('://')
|
||||||
|
const [host, port] = address.split(':')
|
||||||
if (!protocol.includes('socks')) {
|
if (!protocol.includes('socks')) {
|
||||||
setGlobalDispatcher(new ProxyAgent(proxyUrl))
|
setGlobalDispatcher(new ProxyAgent(proxyUrl))
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user