Accessing a Localhost Server on Another Device

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi guys welcome back to the channel so today i have a really really quick um kind of tutorial for you where we're going to be showing you how to connect to a local host server um from another device okay so you can see here i've just got a basic node.js application um when you're getting the app to listen on port 5000 so if i just get this up and running with npm run dev you can do this of any kind of server really it could be a python server but here we're just using node.js you can see here our server's running on port 5000 so if i go to our chrome go to that uh port local host port 5000 you can see there's our kind of website application up on the screen now i find sometimes when editing like these kind of web pages uh these previews so like these device previews can be kind of inaccurate sometimes sometimes the whip won't show correctly that kind of thing so in order to test this on say if you wanted to test this i have an iphone x available on me or an ipad or anything you can connect um to this local host server via the home network okay all you need to do to do this is get your local your host machine's ip address so let's do that we're going to say come to a terminal let's just get a new terminal up and running like so and let me just zoom in a bit so the command you use to get your ip address is um if config on a mac okay i think it's ipconfig on a windows machine if you just do that enter that and then you can see here uh what you're interested in is the en0 section this part here and you'll see your computer's ip address here so this i net you can see here we have 192.168.0.17 so if i come to my mobile now and then we go to a browser if we type in the ip address 192.168.0 and then obviously you want to add the port as well which in this case is 5000 we're listing on you'll see we get our node.js application and running on our mac okay so this just lets us view it as it we can see how it does actually appear on an iphone 10 or whatever device you're visiting this port from okay so that's just a really quick overview guys on how you can connect to a local host server from another device uh the device has to be obviously connected to a um to the same home network as the host device okay so i hope you found this useful and i'll see you next video cheers guys
Info
Channel: Conor Bailey
Views: 126,950
Rating: undefined out of 5
Keywords:
Id: y_Po6Gj8Gkg
Channel Id: undefined
Length: 2min 32sec (152 seconds)
Published: Sun Nov 22 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.