Skip to content

Commit

Permalink
fix: socks proxy agent
Browse files Browse the repository at this point in the history
  • Loading branch information
KagamiChan committed Jun 14, 2022
1 parent 1de99b2 commit 4dfd763
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import querystring from 'querystring'
import mime from 'mime'
import createPacProxyAgent from 'pac-proxy-agent'
import createHttpProxyAgent from 'http-proxy-agent'
import createSocksProxyAgent from 'socks-proxy-agent'
import { SocksProxyAgent } from 'socks-proxy-agent'
import { app, session } from 'electron'
import util from 'util'
import { gunzip, inflate } from 'zlib'
Expand Down Expand Up @@ -300,7 +300,7 @@ class Proxy extends EventEmitter {
const socksPort = config.get('proxy.socks5.port', 1080)
const uri = `${socksHost}:${socksPort}`
if (!this.socksAgents[uri]) {
this.socksAgents[uri] = createSocksProxyAgent(`socks://${uri}`)
this.socksAgents[uri] = new SocksProxyAgent(`socks://${uri}`)
}
options.agent = this.socksAgents[uri]
break
Expand Down

0 comments on commit 4dfd763

Please sign in to comment.