waylaidwanderer / node-chatgpt-api

A client implementation for ChatGPT and Bing AI. Available as a Node.js module, REST API server, and CLI app.
https://www.npmjs.com/package/@waylaidwanderer/chatgpt-api
MIT License
4.2k stars 737 forks source link

Error: Client network socket disconnected before secure TLS connection was established #376

Open dreamsleet opened 1 year ago

dreamsleet commented 1 year ago

TypeError: fetch failed at Object.processResponse (node:internal/deps/undici/undici:6406:34) at node:internal/deps/undici/undici:6727:42 at node:internal/process/task_queues:140:7 at AsyncResource.runInAsyncScope (node:async_hooks:203:9) at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { cause: Error: Client network socket disconnected before secure TLS connection was established at connResetException (node:internal/errors:711:14) at TLSSocket.onConnectEnd (node:_tls_wrap:1593:19) at TLSSocket.emit (node:events:525:35) at endReadableNT (node:internal/streams/readable:1359:12) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { code: 'ECONNRESET', path: undefined, host: 'api.openai.com', port: 443, localAddress: null } } I use ChatGPT, but it reports such an error. Please help me. Thanks

liukaixiang817 commented 1 year ago

Same error with the TUN mode proxy

WaterHyacinthInNANHU commented 12 months ago

TypeError: fetch failed at Object.processResponse (node:internal/deps/undici/undici:6406:34) at node:internal/deps/undici/undici:6727:42 at node:internal/process/task_queues:140:7 at AsyncResource.runInAsyncScope (node:async_hooks:203:9) at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { cause: Error: Client network socket disconnected before secure TLS connection was established at connResetException (node:internal/errors:711:14) at TLSSocket.onConnectEnd (node:_tls_wrap:1593:19) at TLSSocket.emit (node:events:525:35) at endReadableNT (node:internal/streams/readable:1359:12) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { code: 'ECONNRESET', path: undefined, host: 'api.openai.com', port: 443, localAddress: null } } I use ChatGPT, but it reports such an error. Please help me. Thanks

Had the same problem. Bypassed this by using http instead of https proxy.