0

I have a rails server running on my machine. I am running the server using the following command:

rails s -b my_computer_ip

Now, I am trying to access the server on my phone's browser using the following command

http://my_computer_ip:3000

but I keep getting: "The site cannot be reached"

Both my phone and computer are connected over the same network.

I have tried following options:

rails s -b 0.0.0.0 (On computer)
http://192.168.1.80:3000 (On phone)

But do not work.

Earlier I used to connect to server on my phone in the same way I have mentioned but I don't understand what issue is now cropping up.

PS: When I do the following:

 http://my_computer_ip

on my phone's browser, I get the page saying Apache server is running.

Yesha
  • 648
  • 1
  • 7
  • 29
  • https://stackoverflow.com/questions/9887621/accessing-localhost-of-pc-from-usb-connected-android-mobile-device This will help you. :) – Omkar Dec 19 '17 at 12:53

1 Answers1

1

This is a networking concept error. You have to enable the port 3000 in your router. Instead, try running the server on port 80, your firewall is probably blocking port 3000.

maguri
  • 386
  • 2
  • 10
  • Yes you are right. The issue got solved with the following command: sudo ufw allow 3000 – Yesha Dec 20 '17 at 05:05