Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

代理无效报错 #992

Closed
debug529 opened this issue Oct 24, 2020 · 4 comments
Closed

代理无效报错 #992

debug529 opened this issue Oct 24, 2020 · 4 comments
Labels

Comments

@debug529
Copy link

环境

  • 系统/平台: win10 64位

  • nodejs 版本: v12.19.0

  • API版本: 3.44.0

出现问题

不知道是不是我的设置操作问题,使用代理报错

重现步骤

1、使用样例那种好像好像不行,有个疑问哈,代理一般情况是这样设置:‘&proxy_host=121.196.226.246&proxy_port=84’,为啥前面要加前缀’http://’呢?
http://localhost:3000/album?id=96680121&timestamp=1503019930001&proxy=http://192.168.2.201:50000
2、然后我看了下axios的设置,改了下,request.js如下方式设置代理ip
image
请求url:http://localhost:3000/album?id=96680121&timestamp=1503019930001
报错如下:
[ERR] /album?id=96680121&timestamp=1503019930001 {
(node:20712) UnhandledPromiseRejectionWarning: TypeError: Converting circular structure to JSON
status: 502,
--> starting at object with constructor 'Socket'
body: {
code: 502,
| property '_httpMessage' -> object with constructor 'ClientRequest'
msg: Error: socket hang up
--- property 'socket' closes the circle
at connResetException (internal/errors.js:609:14)
at JSON.stringify ()
at stringify (D:\xxxxx\NeteaseCloudMusicApi\node_modules\express\lib\response.js:1123:12)
at Socket.socketOnEnd (_http_client.js:459:23)
at ServerResponse.json (D:\xxxxx\NeteaseCloudMusicApi\node_modules\express\lib\response.js:260:14)
at Socket.emit (events.js:326:22)
at ServerResponse.send (D:\xxxxx\NeteaseCloudMusicApi\node_modules\express\lib\response.js:158:21)
at D:\xxxxx\NeteaseCloudMusicApi\app.js:105:37
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:20712) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 6)
at endReadableNT (_stream_readable.js:1223:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
code: 'ECONNRESET',
config: [Object],
request: [Writable],
response: undefined,
isAxiosError: true,
toJSON: [Function: toJSON]
}
}
}

期待效果

@debug529 debug529 added the bug label Oct 24, 2020
@Binaryify
Copy link
Owner

之前用的是request.js,代理是那样设置的,后面有个PR把request重构成了axios,但是漏改了代理的设置,明天我改改吧

@xiao99xiao
Copy link

@Binaryify just spend 3 hours struggling with the proxy issue before you commented 😭 Every request with proxy returns 502 error currently (with a 404 not found error inside).
Really appreciate if you could fix it tomorrow❤️

Binaryify added a commit that referenced this issue Oct 25, 2020
@Binaryify
Copy link
Owner

已修复

@debug529
Copy link
Author

已修复

cool, 可用, thks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants