LAN vs Tunnel in Expo


#1

Here is a brief overview of the LAN vs Tunnel settings in XDE and exp, etc.

When you develop with Expo, you typically write code and run the metro bundler on your computer, but then want to load your application on your phone. Since those are different devices, you can’t load stuff from localhost the way you might do in web development. Instead, there are two ways that you can load things – tunnel and LAN.

LAN
Using LAN, you connect over your LAN. So, for this to work, you need your phone to be on the same wifi network as your computer, and you need to not have any too-weird settings in your router or corporate firewall, etc.

If you can put your phone and computer onto the same network, this is the fastest and simplest and safest thing, since it has the fewest moving parts and has the phone connect to your computer just through your router.

We recommend using this setting if it works for you

Tunnel

Under the tunnel setting, your computer will setup a tunnel to exp.direct, a domain using the ngrok tunnel service. This means that all your traffic will go through a proxy in the cloud, but it can punch through most firewalls, etc., so it will work under more conditions.

Since this works for more people in more conditions, we’ve made this the default.

We might change this in the future, since LAN is better if you can use it.


Why does Expo URL change when I re-run exp start
closed #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.