mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-05-23 22:37:41 +08:00
Merge pull request #1787 from movefreechen/master
update: 增加对带用户名密码的代理支持
This commit is contained in:
commit
7f21fbcda1
@ -147,10 +147,11 @@ const createRequest = (method, url, data = {}, options) => {
|
||||
} else {
|
||||
const purl = new URL(options.proxy)
|
||||
if (purl.hostname) {
|
||||
const agent = tunnel.httpsOverHttp({
|
||||
const agent = tunnel[purl.protocol === 'https' ? 'httpsOverHttp' : 'httpOverHttp']({
|
||||
proxy: {
|
||||
host: purl.hostname,
|
||||
port: purl.port || 80,
|
||||
proxyAuth: purl.username && purl.password ? (purl.username + ':' + purl.password) : ''
|
||||
},
|
||||
})
|
||||
settings.httpsAgent = agent
|
||||
|
Loading…
x
Reference in New Issue
Block a user