sindresorhus / got

🌐 Human-friendly and powerful HTTP request library for Node.js
MIT License
14.27k stars 935 forks source link

RequestError: connect ETIMEDOUT #1678

Closed atubo2012 closed 3 years ago

atubo2012 commented 3 years ago

Describe the bug

image

Actual behavior

Got above error.

...

Expected behavior

Get content about blog ,like this: image

...

Code to reproduce

const got = require('got');

(async () => {
    try {
        const response = await got('https://www.googleapis.com/blogger/v3/blogs/4635670594938406451/posts/7881404100950905564?key=xxxxxxxx-xxxxx');
        console.log(response);
    } catch (error) {
        console.log('error occur :',error);
        //=> 'Internal server error ...'
    }
})();

But it works in gitpod, I am wondering if it was caused by vpn :(

Checklist

szmarczak commented 3 years ago

Got works correctly here.

atubo2012 commented 3 years ago

Solved after environment variable http_proxy is set : http_proxy=http://127.0.0.1:10001
The port number could be found in "Internet option->connection->LAN setting->Proxy". Thank you!