0

I made an app which has React Front-End and Laravel Back-end. It works fine on my desktop but i tried running it on other devices in my house and they wont connect with the server:

I tried the following:

  1. php -S ip:8888 -t public
  2. php artisan serve --host 0.0.0.0 --port 8888

On my desktop ( the place where the server is hosted on ) i can connect to the server just by writing ip:8888/ in the browser search. However, any other device won't pick this up. I Tried port forwarding the port 8888 from my desktop but that didnt work either.

Any clue on why this might be?

mybrave
  • 1,662
  • 3
  • 20
  • 37
  • 1
    Try some of [these](https://stackoverflow.com/questions/4779963/how-can-i-access-my-localhost-from-my-android-device). – Tpojka Apr 07 '20 at 16:56
  • thanks but i did, copying the ipv4 adress doesn't work, the server seems to be open just to the dekstop istelf and not any other devices connected on the same network – Mihnea Radu Apr 07 '20 at 19:08
  • 1
    If you don't want to investigate further how to make localhost server available to mobile device over Wi-Fi, I would say that simplest way would be [ngrok](https://ngrok.com/) service. – Tpojka Apr 07 '20 at 19:11
  • I'm definetly going to look into that thanks! but out of couriosity do you know a solution that doesnt involve any 3rd paries? – Mihnea Radu Apr 07 '20 at 19:29
  • 1
    I remember when I needed something similar I followed answers from link posted in my first comment and also read and study articles that I found by googling something like "localhost and mobile device". It is not easy to answer, it depends of many factors like OS etc. But I think I used vagrant server. Which shouldn't be limiting factor per se, just telling there is lot of things that need to be set/checked. If you don't have experience, use ngrok, if you are experienced find first 10 articles under "localhost and mobile device", read, follow and you'll be able to set your environment. – Tpojka Apr 07 '20 at 19:44
  • i tried a couple of things from the articles that i tried and none seemed to make a diffrence, tried even asking help from a senior dev and he seemed clueless as of why did hasppens so i guess ill remain in the unkown haha. Thanks for the help! – Mihnea Radu Apr 07 '20 at 19:59
  • Ok, let's try: what OS? – Tpojka Apr 07 '20 at 20:04
  • I run windows 10 – Mihnea Radu Apr 07 '20 at 20:05
  • OSX here. First obstacle. Trying to find something useful on net. – Tpojka Apr 07 '20 at 20:10
  • Is computer on Wi-Fi [on same wireless network] or is it connected to internet over the cable? – Tpojka Apr 07 '20 at 20:12
  • It's from a cable yup. – Mihnea Radu Apr 07 '20 at 20:13
  • That's second issue. You need then to manage activities of two networks - cable and wi-fi networks to work as one. :/ Can you check local IPs of computer and mobile (not one got from provider but rather local ones). – Tpojka Apr 07 '20 at 20:18
  • 1
    Yup, i have a Deco-Router (Mesh wifi) and it shows me the local ipv4 of both devices thru it's mobile app. I tried connecting them to the same single device ( i have 3 of them that spread the network so i have thought this might be a problem ). That didnt work out. Next, i tried portforwarding the port where the laravel server is opened up and then retried with the ipv4 and the normal ip, none of these worked either – Mihnea Radu Apr 07 '20 at 20:23
  • I think here is too many things unknown or misconfigured (between your and my systems) so I kindly advice you to test ngrok which btw I use regularly from time to time. – Tpojka Apr 07 '20 at 20:28
  • 1
    I get it. Thanks for the advice anyway! thanks for trying to help me understand too! Have a nice day – Mihnea Radu Apr 07 '20 at 20:31

0 Answers0