mirror of
https://github.com/jehna/humanify.git
synced 2026-04-27 09:35:58 +03:00
[GH-ISSUE #265] How to set IP proxy? Requests to openai easily time out #63
Labels
No labels
bug
enhancement
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/humanify#63
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @xiaowanjiagit on GitHub (Jan 4, 2025).
Original GitHub issue: https://github.com/jehna/humanify/issues/265
(node:5760) [DEP0040] DeprecationWarning: The
punycodemodule is deprecated. Please use a userland alternative instead.(Use
node --trace-deprecation ...to show where the warning was created)Processing file 1/3
file:///D:/Program%20Files/nodejs/node_global/node_modules/humanifyjs/node_modules/openai/core.mjs:316
throw new APIConnectionError({ cause: response });
^
APIConnectionError: Connection error.
at OpenAI.makeRequest (file:///D:/Program%20Files/nodejs/node_global/node_modules/humanifyjs/node_modules/openai/core.mjs:316:19)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async file:///D:/Program%20Files/nodejs/node_global/node_modules/humanifyjs/dist/index.mjs:55216:26
at async visitAllIdentifiers (file:///D:/Program%20Files/nodejs/node_global/node_modules/humanifyjs/dist/index.mjs:55082:21)
at async file:///D:/Program%20Files/nodejs/node_global/node_modules/humanifyjs/dist/index.mjs:55210:12
at async unminify (file:///D:/Program%20Files/nodejs/node_global/node_modules/humanifyjs/dist/index.mjs:172:27)
at async Command. (file:///D:/Program%20Files/nodejs/node_global/node_modules/humanifyjs/dist/index.mjs:55292:3) {
status: undefined,
headers: undefined,
request_id: undefined,
error: undefined,
code: undefined,
param: undefined,
type: undefined,
cause: FetchError: request to https://api.openai.com/v1/chat/completions failed, reason:
at ClientRequest. (D:\Program Files\nodejs\node_global\node_modules\humanifyjs\node_modules\node-fetch\lib\index.js:1501:11)
at ClientRequest.emit (node:events:518:28)
at emitErrorEvent (node:_http_client:103:11)
at TLSSocket.socketErrorListener (node:_http_client:506:5)
at TLSSocket.emit (node:events:530:35)
at emitErrorNT (node:internal/streams/destroy:170:8)
at emitErrorCloseNT (node:internal/streams/destroy:129:3)
type: 'system',
errno: 'ETIMEDOUT',
code: 'ETIMEDOUT'
}
}
@jehna commented on GitHub (Jan 4, 2025):
Do you have an unreliable internet? Would setting a proxy help in this case?
@xiaowanjiagit commented on GitHub (Jan 5, 2025):
yes, unreliable internet
@jehna commented on GitHub (Jan 5, 2025):
I'm pretty sure that you can use
HTTP_PROXYandHTTPS_PROXYenvironment variables to set the http proxy. Current undici seems to support it and I'd assume the underlying openai library would be using undici.@jehna commented on GitHub (Jan 5, 2025):
Hmm, seems that openai is still using node-fetch, so it might not work:
github.com/openai/openai-node@f4066e1af9/README.md (L2-L5)@0xdevalias commented on GitHub (Feb 18, 2025):
github.com/openai/openai-node@212710db8c/README.md (L1-L5)Related upstream issues / workarounds for
node-fetchnot supportingHTTP_PROXY/ etc:@0xdevalias commented on GitHub (May 30, 2025):
Looks like
openaiv5 is out now, which uses the nativefetch, and has better support for proxies: