How do I connect to this localhost from another computer on the same network?

后端 未结 8 2047
陌清茗
陌清茗 2020-11-22 16:48

I\'m currently working on a project and I would like to test it out on two laptops at home where one laptop connects to the localhost on the other. I am using XAMPP. How do

相关标签:
8条回答
  • 2020-11-22 17:37

    This tool saved me a lot, since I have no Admin permission on my machine and already had nodejs installed. For some reason the configuration on my network does not give me access to other machines just pointing the IP on the browser.

    # Using a local.dev vhost
    $ browser-sync start --proxy
    
    # Using a local.dev vhost with PORT
    $ browser-sync start --proxy local.dev:8001
    
    # Using a localhost address
    $ browser-sync start --proxy localhost:8001
    
    # Using a localhost address in a sub-dir
    $ browser-sync start --proxy localhost:8080/site1
    

    http://www.browsersync.io/docs/command-line/

    0 讨论(0)
  • 2020-11-22 17:38

    it may be that your firewalls are preventing you from accessing the localhost's webserver.
    Put the IP addresses of both of your computers' internet security antivirus network security as safe IP addresses if required.
    How to find the IP address of your windows PC: Start > (Run) type in: cmd (Enter)
    (This opens the black box command prompt)
    type in ipconfig (Enter)
    Let's say your Apache or IIS webserver is installed on your PC: 192.168.0.3
    and you want to access your webserver with your laptop. (laptop's IP is 192.168.0.5)
    On your PC you type in: http://localhost/ inside your Firefox or Internet Eplorer browser to access your data on your webserver.
    On your laptop you type in http://192.168.0.3/ to access your webserver on your PC.

    For all these things to work you need have installed a webserver correctly (e.g. IIS, Apache, XAMP, WAMP etc).

    If it does not work, try to ping your PC from your laptop:
    Open up command propmt on your laptop: Start > cmd (Enter)
    ping 192.168.1.3 (Enter)
    If the pinging fails, then firewalls are blocking your connection or your network cabling is faulty. Restart your modem or network switch and your machines.
    Close programs such as chat programs that are using your ports.
    You can also try a diffrent port number: http:192.168.0.3:80 or http:192.168.0.3:81 or any random number at the end

    0 讨论(0)
提交回复
热议问题