Add Proxy Support
Thanks for stopping by to let us know something could be better!
Please run down the following list and make sure you've tried the usual "quick fixes":
- Check the Emulator's docs
- Check the Emulator's self-help:
functions --helporfunctions-emulator --help - Search the issues already opened: https://github.com/GoogleCloudPlatform/cloud-functions-emulator/issues
- Search StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform+node.js
If you are still having issues, please be sure to include as much information as possible:
Environment details
- OS: macOS v10.13.4
- Node.js version: v6.11.5
- npm version: v3.10.10
- @google-cloud/functions-emulator version: v1.0.0-beta.4
Steps to reproduce
- $ functions start
- $ functions deploy hello --trigger-http
Got
functions deploy hello --trigger-http
ERROR: Error: read ECONNRESET
at RequestError.Error (native)
at new RequestError (/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/googleapis/node_modules/google-auth-library/lib/transporters.js:34:42)
at Request._callback (/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/googleapis/node_modules/google-auth-library/lib/transporters.js:108:23)
at Request.self.callback (/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/request/request.js:186:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request.<anonymous> (/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/request/request.js:1163:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/request/request.js:1085:12)
The local emulator needs to access Google auth service, but all Google services are blocked in China. So I need to use a proxy for it.
I tried
-
http_proxy,https_proxyEnvironment variable - gcloud proxy settings
No luck, it seems local emulator does not support proxy yet. And I haven't find any documentation related to proxy on the Wiki.
Why does the emulator need to phone home (Google, Mountain View ) ? I am facing a similar issue and would like to be able to use the emulator while travelling without an Internet connection. I get a timeout when issuing "functions start":
at new RequestError (C:\Users\s3cnpj\Downloads\node-v8.4.0-win-x64\node_modules\@google-cloud\functions-emulator\node_modules\googleapis\node_modules\google-auth-library\lib\transporters.js:34:42)
I met same problems too under proxy on windows. On windows, I got
''' ERROR: Error: getaddrinfo EAI_AGAIN cloudfunctions.googleapis.com:443 at new RequestError (C:\Users\USER_NAME\AppData\Roaming\npm\node_modules@google-cloud\functions-emulator\node_modules\googleapis\node_modules\google-auth-lib rary\lib\transporters.js:34:42) at Request._callback (C:\Users\USER_NAME\AppData\Roaming\npm\node_modules@google-cloud\functions-emulator\node_modules\googleapis\node_modules\google-auth-li brary\lib\transporters.js:108:23) '''
as of this date... this is still not fixed... Tried the same options, setting the proxy on node, and as environment variable.