Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trying to view my localhost on my ipad so I don't have to deploy a website first

Ok,so this might be an odd question for this forum, but I can't find anything on it anywhere. I am new to web development, I've been at it for about 6 months and I'm slowly getting better. I create localhosts on my comp to view the look of my development for any website I'm building, this way I can see how the site reacts in a real-world setting. I'm positive that most developers do this. What I would like to know is if there is a way to connect an iPad or iPhone to that particular localhost so I can view how responsive my website is before I deploy it? There's got to be some way to view your developing website on a mobile device, I just have no clue on how to do that. So, if anyone is familiar with this, I would really appreciate some advice. Thanks, guys!!

like image 944
ajmatic Avatar asked Dec 27 '13 23:12

ajmatic


People also ask

How do I access my localhost browser?

For the local address field, enter localhost: followed by the port that your proxy server is running on. For example, if it's running on port 8000 , then you would enter localhost:8000 .

How do I expose my localhost Internet?

Exposing localhost with cloudflare tunnels Just download and install the Cloudflare Tunnel CLI tool. Run the tunnel command and point it to the host port you want to serve and it will spit out a URL.

How do I access localhost on my Iphone?

Running localhostNavigate to http://yourname.local:8000 on your phone and you're all set!


2 Answers

I assume that your iPad and computer are connecting to the same wireless router. The IP of your PC and iPad should both start with 192.168... Then viewing your localhost site on iPad is absolutely possible. e.g If your localhost site is on the PC with IP of 192.168.0.100 with port:8080, you can connect this site on iPad through url: http://192.168.0.100:8080

like image 115
EricLee Avatar answered Nov 05 '22 11:11

EricLee


If using Mac for a Rails app.

  1. In terminal Ctrl-C to shut down previous server
  2. Go into your System Preferences on your mac, then "Network". Under connected you will "Wi-Fi is connected to _____________ and has the IP address 192.XXX.X.XX."
  3. Go to terminal, type rails s --binding=192.XXX.X.XX <-- use your IP not Xs
  4. In the browser address bar on your Ipad type http://192.XXX.X.XX:3000
like image 28
Philip Duffney Avatar answered Nov 05 '22 13:11

Philip Duffney