Access emulated functions from local network

663 views
Skip to first unread message

Levani Melikishvili

unread,
Oct 8, 2019, 7:58:42 PM10/8/19
to Firebase Google Group
Is it possible to access emulated functions (firebase emulators:start) from local network?

My workflow is following:

I Have a react native expo project with firebase sdk.

I also have several callable functions in firebase. If I use ios simulator and call these functions, they work as expected.

However if I open the app on a real android device these functions are unaccessible... Trying to open 192.168.x.x:5001 also does not return any result. localhost:5001 does.

I want to test push notifications so using always a simulator is not an option.

Am I doing something wrong here? Should these function be accessible from local network?

Sam Stern

unread,
Oct 8, 2019, 8:06:18 PM10/8/19
to Firebase Google Group
Hi Levani,

There are some tools you can use to expose things running on localhost to the internet.  For example you could try pagekite or ngrok.  These will give your functions a public address that you can access from any device.  Of course you have to be very careful with things like this because they expose your machine to the world! 

- Sam

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/b7f58e6c-12e1-4db9-9894-4db21c5fed7d%40googlegroups.com.

Levani Melikishvili

unread,
Oct 9, 2019, 10:58:59 AM10/9/19
to Firebase Google Group
I know about ngrok but I don't want it to be accessible to the internet, just my local network. firebase serve has a --host option. From docs

By default, firebase serve only responds to requests from localhost. This means that you'll be able to access your hosted content from your computer's web browser but not from other devices on your network. If you'd like to test from other local devices, use the --host flag:

firebase serve --host 0.0.0.0 // accepts requests to any host  

I need something similar from firebase emulators:start

On Wednesday, October 9, 2019 at 4:06:18 AM UTC+4, Samuel Stern wrote:
Hi Levani,

There are some tools you can use to expose things running on localhost to the internet.  For example you could try pagekite or ngrok.  These will give your functions a public address that you can access from any device.  Of course you have to be very careful with things like this because they expose your machine to the world! 

- Sam

On Tue, Oct 8, 2019 at 4:58 PM Levani Melikishvili <levan...@gmail.com> wrote:
Is it possible to access emulated functions (firebase emulators:start) from local network?

My workflow is following:

I Have a react native expo project with firebase sdk.

I also have several callable functions in firebase. If I use ios simulator and call these functions, they work as expected.

However if I open the app on a real android device these functions are unaccessible... Trying to open 192.168.x.x:5001 also does not return any result. localhost:5001 does.

I want to test push notifications so using always a simulator is not an option.

Am I doing something wrong here? Should these function be accessible from local network?

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fireba...@googlegroups.com.

Doug Stevenson

unread,
Oct 9, 2019, 5:36:03 PM10/9/19
to Firebase Google Group
Firebase Cloud Messaging should work OK on Android emulators that have Play Services installed.  Are you saying that it doesn't work for you?

Doug

Levani

unread,
Oct 9, 2019, 6:40:52 PM10/9/19
to fireba...@googlegroups.com
No, I want to test it on a real android device.

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/4c50a610-04cb-4e07-b1b5-fd973a96b0ea%40googlegroups.com.

Sam Stern

unread,
Oct 14, 2019, 12:47:45 PM10/14/19
to Firebase Google Group
Thanks for explaining, I filed this issue on the firebase-tools repo so we can track this:

Reply all
Reply to author
Forward
0 new messages