Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Mar 2012
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How can i access localhost from my phone?

    of course i can access localhost on my pc, but i wanna access it on my andriod, we are sharing the same network via wifi

    thnks for the help this would help alot

  • #2
    Regular Coder
    Join Date
    Jun 2010
    Posts
    293
    Thanks
    63
    Thanked 8 Times in 8 Posts
    You should just be able to go to localhost on your phone's browser like you would on any other machine. Type localhost into the address bar on your phone's browser and tap 'go' ... it should work!

  • #3
    New Coder
    Join Date
    Mar 2012
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    that doesn't work so im thinking firewall settings

  • #4
    New Coder
    Join Date
    Mar 2012
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    doesnt work and fire wall setting are off any suggestions?

  • #5
    Regular Coder stevenmw's Avatar
    Join Date
    Jun 2007
    Location
    OK
    Posts
    497
    Thanks
    27
    Thanked 31 Times in 31 Posts
    That's odd. it should simply work. Log into your router and look for connected devices. If your phone shows up in the list then that is even more odd, but if it isn't you know it isn't on the LAN.

    If it works on your pc, it should work on your phone. You're absolutely sure you're on the same LAN? Make sure your 3 or 4 g is turned off, and only wifi is on your phone.

    Try 127.0.0.1
    Thanks!

  • #6
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,620
    Thanks
    0
    Thanked 645 Times in 635 Posts
    localhost is always the web server running on the device you are using. Presumably your phone isn't running a web server and you want to access the web server on your local computer - in which case just substitute the IP address of that computer and don't use 127.0.0.1

    For example if the server is running on a computer with IP address 192.168.1.25 then on that computer 127.0.0.1, localhost and 192.168.1.25 all point to the same place but the only one that points to the web server on that computer from other devices is 192.168.1.25
    Last edited by felgall; 12-01-2012 at 06:07 AM.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #7
    New Coder
    Join Date
    Mar 2012
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by felgall View Post
    localhost is always the web server running on the device you are using. Presumably your phone isn't running a web server and you want to access the web server on your local computer - in which case just substitute the IP address of that computer and don't use 127.0.0.1

    For example if the server is running on a computer with IP address 192.168.1.25 then on that computer 127.0.0.1, localhost and 192.168.1.25 all point to the same place but the only one that points to the web server on that computer from other devices is 192.168.1.25
    i wanna write a rap song about you

  • #8
    Regular Coder
    Join Date
    Jun 2010
    Posts
    293
    Thanks
    63
    Thanked 8 Times in 8 Posts
    Quote Originally Posted by felgall View Post
    localhost is always the web server running on the device you are using. Presumably your phone isn't running a web server and you want to access the web server on your local computer - in which case just substitute the IP address of that computer and don't use 127.0.0.1

    For example if the server is running on a computer with IP address 192.168.1.25 then on that computer 127.0.0.1, localhost and 192.168.1.25 all point to the same place but the only one that points to the web server on that computer from other devices is 192.168.1.25
    *facepalm*

    Yes, that's perfectly obvious now that you've pointed out the obvious!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •