-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
connect ETIMEDOUT 31.13.70.33:443 #79
Comments
I had the same problem
|
if you are in China, may this can help you: |
If you are in China and have a available proxy, you can resolve this prolem by this: openai.createCompletion({ ...params }, {
httpsAgent: tunnel.httpsOverHttp({
proxy: {
host: 'xx.xx.xx',
port: xx,
}
})
}); |
I have tried to use your solution to solve the problem, but it didn't work and still returned 'An error occurred during your request'. |
it worked, you can find it in my project: https://github.com/behappy-project/behappy-chatgpt-assistant/blob/main/lib/openai.js const {Configuration, OpenAIApi} = require("openai");
const tunnel = require('tunnel');
const axios = require('axios');
exports.openai = (opts = {}) => {
const configuration = new Configuration({
apiKey: opts.apiKey,
});
const client = axios.create({
httpsAgent: tunnel.httpsOverHttp({
proxy: {
host: '127.0.0.1',
port: 7890,
}
})
});
const openai = new OpenAIApi(configuration, configuration.basePath, client);
return async (ctx, next) => {
ctx.openai = openai;
await next();
};
}; |
Don't forget to |
After config the proxy,i got an error. Here's the error 'Error with OpenAI API request: tunneling socket could not be established, cause=socket hang up' |
|
I got it. I config the host correctly, but i mistakenly config the port. I configured the port with 3000 which is not my Great Firewall software's port. |
thks, it works |
Describe the bug
When I npm run dev and request the interface, this error is reported, and I can't ping 31.13.94.36, how should I solve this problem?
To Reproduce
1.npm install
2.npm run dev
3.connect ETIMEDOUT 31.13.70.33:443
OS
No response
Node version
No response
The text was updated successfully, but these errors were encountered: