googlearchive / cloud-functions-emulator

A local emulator for deploying, running, and debugging Google Cloud Functions.
https://github.com/GoogleCloudPlatform/cloud-functions-emulator/wiki
Apache License 2.0
828 stars 115 forks source link

Google Cloud Functions emulator with corporate proxy #179

Open dfit opened 6 years ago

dfit commented 6 years ago

I'm currently setting up my work environment for testing google cloud platform on a company project.

By far, I succeed to deploy functions on the g cloud platform and using them in prod condition. I wanted to have the local emulator working on my computer also, so I tried to install it with this tutorial

But I encounter a problem right after wanted to start the emulator with "functions start" :

C:\Users\David>functions start
Starting Google Cloud Functions Emulator...
Google Cloud Functions Emulator STARTED
ERROR: Error: <!--# Id: internetaccess.html 115044 2016-03-18 17:59:46Z szhang -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<meta name="description" content="Zscaler makes the internet safe for businesses by protecting their employees from malware, viruses, and other security threats.">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Internet Security by Zscaler</title>
<script language="JavaScript">var defLang = 'en_US'</script>
<!--Decathlon_Corp-->

// I cut the style tag here

<![endif]-->
<div class="pg red">
<div class="pg_cont">
<div id="logo_container" class="logo_container">
<table id="logo" width="50%" cellspacing="0" cellpadding="0" border="0" align="center">
<tbody>
<tr align="center">
<td align="center" class="bh">
<img src="https://login.zscaler.net:443/__zsig/ScnVnqvF2T5M6" /></td></tr>
</tbody></table></div>
<table class="m_tbl" cellpadding="0" cellspacing="0" align="center">
<tbody><tr>
<td height="100" valign="top" style="position:relative;">
<div class="uq_cd">D22</div>
<!--locale en_US-->
<table id="en_US" width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody><tr><td class="eu_h">
<i class="a_i"></i>
Sorry, you don't have permission to visit this site.
</td></tr>
<tr><td class="hr"><hr></td></tr>
<tr><td class="eu_co">
<b><div align="left">En effet, il est soit illégal, soit dangereux pour notre système d'information, soit hors valeur de l'entreprise.
<br>Pour plus d'information sur les raisons de ce blocage, tu peux relire la charte informatique en vigueur dans ton pays ou les "carrés rouges" (en l'absence de charte).</br>
<br>En cas de besoin, tu peux contacter ton assistance informatique..</br></div>
<div align="left"><P>It is illegal or dangerous for our information system or not in the values of the group.
<br>For more information about this notification, you can read the IT Charter of your country or the “red card” (in case of absence of charter)</br>
<br><a onclick="history.back(-2);">Retour à la page précedente / Back</a></br>
<br>In case of need, you can contact your helpdesk.</br></P></div></b>
</td></tr>
<tr><td class="eu_co rsn">
Denied
</td></tr>
<tr><td class="eu_co">
You tried to visit:<div class="eu_l"><a href="http://localhost:8008/$discovery/rest?version=v1beta2">http://localhost:8008/$discovery/rest?version=v1beta2</a></div>
</td></tr><tr>
<td class="hr"><hr></td>
</tr>
<tr><td class="eu_co fo">
</td></tr>
<tr><td class="eu_co st">
<span class="s_img"></span>
Your organization has selected Zscaler to protect you from internet threats.
</td></tr>
</tbody></table>
<!--/locale en_US-->
</td></tr>
</tbody></table>
</div>
</div>
</body></html>
<!-- 0 0 1 0 1513847248 32 http://localhost:8008/$discovery/rest?version=v1beta2 -->
    at new RequestError (C:\Users\David\AppData\Roaming\npm\node_modules\@google-cloud\functions-emulator\node_modules\google-auth-library\lib\transporters.js:34:42)
    at Request._callback (C:\Users\David\AppData\Roaming\npm\node_modules\@google-cloud\functions-emulator\node_modules\google-auth-library\lib\transporters.js:108:23)
    at Request.self.callback (C:\Users\David\AppData\Roaming\npm\node_modules\@google-cloud\functions-emulator\node_modules\request\request.js:186:22)
    at emitTwo (events.js:126:13)
    at Request.emit (events.js:214:7)
    at Request.<anonymous> (C:\Users\David\AppData\Roaming\npm\node_modules\@google-cloud\functions-emulator\node_modules\request\request.js:1163:10)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at IncomingMessage.<anonymous> (C:\Users\David\AppData\Roaming\npm\node_modules\@google-cloud\functions-emulator\node_modules\request\request.js:1085:12)
    at Object.onceWrapper (events.js:313:30)

I already tried by setting proxy on node config level and on system level.

Tried by reinstalling completely node on my computer but didn't figure out what I was missing.

(just to know i'm on windows)

Thanks in advance for any kind of information.

Environment details

HaoH commented 6 years ago

I have a similar problem. I use shadowsocks proxy to access google cloud functions. But my proxy works well when I use other google apis, e.g. text-to-speech, speech.

Environment:

error infomation $ functions-emulator start

Starting Google Cloud Functions Emulator... Google Cloud Functions Emulator STARTED ERROR: Error:

500 Internal Privoxy Error

500 Internal Privoxy Error

Privoxy encountered an error while processing your request:

Could not load template file no-server-data or one of its included components.

Please contact your proxy administrator.

If you are the proxy administrator, please put the required file(s)in the (confdir)/templates directory. The location of the (confdir) directory is specified in the main Privoxy config file. (It's typically the Privoxy install directory, or /etc/privoxy/).

at RequestError.Error (native)
at new RequestError (/Users/wukong/.nvm/versions/node/v6.11.5/lib/node_modules/@google-cloud/functions-emulator/node_modules/googleapis/node_modules/google-auth-library/lib/transporters.js:34:42)
at Request._callback (/Users/wukong/.nvm/versions/node/v6.11.5/lib/node_modules/@google-cloud/functions-emulator/node_modules/googleapis/node_modules/google-auth-library/lib/transporters.js:108:23)
at Request.self.callback (/Users/wukong/.nvm/versions/node/v6.11.5/lib/node_modules/@google-cloud/functions-emulator/node_modules/request/request.js:185:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request.<anonymous> (/Users/wukong/.nvm/versions/node/v6.11.5/lib/node_modules/@google-cloud/functions-emulator/node_modules/request/request.js:1157:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage.<anonymous> (/Users/wukong/.nvm/versions/node/v6.11.5/lib/node_modules/@google-cloud/functions-emulator/node_modules/request/request.js:1079:12)