0

I have been working on a NativeScript project that uses an API. The API project is on my MacBook and haven't deployed to anywhere yet. It's based on Laravel and I use Laravel Valet as development environment.

I can't test the mobile app on iPhone because the app can't connect to local API URL. I know Valet has "share" command, but because the API consumes another API -which has IP restrictions-, it doesn't work for me. Sharing a local domain via Valet's share command is something like a proxy as I understand, so the consumed API doesn't work on that proxy.

I also checked articles about how to share Macbook's network with iPhone, but it only shares the same network. I can't access the local API still.

Is there any other way that can resolve my issue? Maybe a Docker based solution? I am not that good at Docker, but I can give a try if it is possible with it.

Koray Küpe
  • 716
  • 6
  • 24

1 Answers1

0

https://ngrok.com/ will happily expose your local Laravel Valet server.

Looks like there's a bit of a walk through on that here too https://mannyisles.com/using-laravel-valet-and-ngrok/ which may help?

danblundell
  • 1,443
  • 12
  • 7
  • That said, looks like `valet share` maybe uses ngrok behind the scenes. Might be worth a try separating the two though, seems odd that the IP restricted API wouldn't work behind the proxy? – danblundell Oct 29 '19 at 11:50
  • It's the same thing that `valet share` uses actually. It keeps saying 'connecting' and can't create a session. It is because of work network. Maybe IP restricted IP would work if ngrok works on the work network. If I can't find another option I will have to talk to IP to give access for ngrok. – Koray Küpe Oct 29 '19 at 12:44