Node Script Error: ETIMEDOUT -4039


Frist time wrinting, English is not my first languaje, so please forgive me.

I have a problem with a nodeJS script using the openai module and the same with an axio post request. When I get the response I get an error ETIMEDOUT -4039. The same script works on my home computer, but the error apears on the work computer. At work we have a vpn and a proxy server, so I beleve that’s the issue. I have tried to set the proxy in powershell with no result. The question is: What do I have to ask IT to change or give me acces to? I’m out of ideas.

Thanks in advance.

Welcome to the community.

Sounds like you might need to have your IT people whitelist that machine’s IP to let it through without the VPN.

No other changes to the script between work and home?

1 Like

Thanks Paul,

As it’s the company policy to use the VPN, this is not an option, but you gave me an idea, it’s possible that the VPN is blocking the ip and the port of the endpoint. So if they configure it correctly it may be the solution. As it’s a big company it will take time but will write back with the result.

P.S: Yes, the code is the exactly the same.

1 Like

My idea would be spinning up a server (“EC2 instance”) on AWS and then run your script.
The last time I used AWS (3 months ago), a single micro server instance was free of charge to run.
To then develop on the same server you can use VSCode and connect to the instance using it’s “Connect to host” feature. It will open VSCode as if the file was locally on your system, so you can tweak, save and run it in real-time.

1 Like

Thanks, I’ll look in to that as IT looks at the VPN.

1 Like