fa0311 / twitter-openapi-typescript

Implementation of Twitter internal API (Twitter graphql API) in TypeScript
https://www.npmjs.com/package/twitter-openapi-typescript
Other
73 stars 11 forks source link

proxy error raw.githubusercontent.com #109

Closed web3tool-ai closed 2 weeks ago

web3tool-ai commented 2 weeks ago

when I use proxy: api.setInitOverrides({ agent: proxyAgent } as any); it's alloways throw:reject(new FetchError(request to ${request.url} failed, reason: ${err.message}, 'system', err)); ^ FetchError: request to https://raw.githubusercontent.com/fa0311/latest-user-agent/refs/heads/main/header.json failed, reason: getaddrinfo ENOENT raw.githubusercontent.com at ClientRequest. (\node_modules\node-fetch\lib\index.js:1501:11) at ClientRequest.emit (node:events:518:28) at TLSSocket.socketErrorListener (node:_http_client:500:9) at TLSSocket.emit (node:events:518:28) at emitErrorNT (node:internal/streams/destroy:169:8) at emitErrorCloseNT (node:internal/streams/destroy:128:3) at processTicksAndRejections (node:internal/process/task_queues:82:21) Did raw.githubusercontent.com not use the proxy?

fa0311 commented 2 weeks ago

How are your proxies set up?

chenxhong commented 2 weeks ago

How are your proxies set up?

the same code with example proxy.ts

chenxhong commented 2 weeks ago

like my servers question

fa0311 commented 2 weeks ago

Did raw.githubusercontent.com not use the proxy?

Yes, This bug has been fixed.

the same code with example proxy.ts

Thanks.

Missing initOverrides is the cause. https://github.com/fa0311/twitter-openapi-typescript/pull/110/commits/3fa6dc6f8459adba7971f323b0741496df3d8e9f#diff-c06b4eab0e59918e81a687c5f2931c789c837b6399e0cc237dd8f18b8b076153R44-R47