I am using the firebase emulator to host some GCF functions on my machine. They are configured to run/host on localhost:5001. This works great.
I am now using Google Tasks in my app, and the task I have needs to call a GCF function. Tasks does not run locally, so I've setup my machine to be accessed via a public IP address and opened the port 5001 to allow traffic in on that port. The idea is that the Google task can call the function on my machine, so I can properly test.
I cannot seem to get the emulator to work with any outside public IP address. Is this just not possible or if it is, how do I configure?
UPDATED, there isn't much code to review here...I am just wanting to know if you can configure the emulator to listen on a public port. Here is the default firebase.json file
{
"functions": {
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint"
],
"source": "functions"
},
"emulators": {
"functions": {
"port": 5001
},
"pubsub": {
"port": 8085
},
"ui": {
"enabled": true
}
}
}
In my research, I found you can add the "host" attribute to allow your local network to access the emulator using "host": "0.0.0.0", so it looks like this: This works to allow access via my local ip like http://192.168.1.216:5001
{
"functions": {
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint"
],
"source": "functions"
},
"emulators": {
"functions": {
"port": 5001,
"host": "0.0.0.0"
},
"pubsub": {
"port": 8085
},
"ui": {
"enabled": true
}
}
}
Now, using my public ip, which is setup using NAT FORWARDING, it can't access the site http://108.49.78.181:5001
there isn't code so much as, is this even possible? If it is, I'd love some example of how to do it.