cloudflare / serverless-cloudflare-workers

Serverless provider plugin for Cloudflare Workers
BSD 3-Clause "New" or "Revised" License
175 stars 37 forks source link

Connecting to CloudFlare API through corporate proxy #45

Open cyberfox1 opened 5 years ago

cyberfox1 commented 5 years ago

I have set all the usual HTTP_PROXY etc but it does not work. Is there a way?

cyberfox1 commented 5 years ago

` Serverless: Packaging service... Serverless: Excluding development dependencies...

Fetch Error --------------------------------------------

FetchError: request to https://api.cloudflare.com/client/v4/zones/c00f33815cde7500057aa26ef52c7a3b/workers/settings failed, reason: getaddrinfo ENOTFOUND api.cloudflare.com api.cloudflare.com:443 at ClientRequest. (/home/mnt/mapot/dev/repos/squirrel.git/node_modules/cloudflare-workers-toolkit/node_modules/node-fetch/lib/index.js:1455:11) at emitOne (events.js:116:13) at ClientRequest.emit (events.js:211:7) at TLSSocket.socketErrorListener (_http_client.js:387:9) at emitOne (events.js:116:13) at TLSSocket.emit (events.js:211:7) at emitErrorNT (internal/streams/destroy.js:64:8) at _combinedTickCallback (internal/process/next_tick.js:138:11) at process._tickDomainCallback (internal/process/next_tick.js:218:9) `

cyberfox1 commented 5 years ago

Seems this module is not making proper use of node-fetch:

fetch('https://www.google.com',{ agent:new HttpsProxyAgent('http://127.0.0.1:8580')}).then(function(res){ ... })