Reputation: 2248
I developing a mobile application using React Native. For testing, I run the application on a physical iPhone which means pointing the device to the React Native server running on port 8081 of my laptop. As a remote developer, I often work in coffee shops, libraries, or other public places with WiFi.
My issue is some of these public places block traffic between devices so even if the phone and development machine are on the same network, the mobile device is unable to reach the React Native server.
One remedy I have found is to create a private network between the iPhone and my Macbook. While this solved the issue of connecting to the React Native server, it cuts my laptop off from a public internet connection so this is not a viable option.
Is there a solution to this problem which retains a public internet connection for my devices and also allows comunication between the phone and the React server?
Upvotes: 2
Views: 785
Reputation: 32392
https://ngrok.com allows you to setup secure tunnels to localhost that you can access on the public internet.
Test mobile apps against a development backend running on your machine. Point ngrok at your local dev server and then configure your app to use the ngrok URL. It won't change, even when you change networks.
Upvotes: 2