2 devices connected to the same address via Wireless

Asked

Viewed 377 times

-2

I am using Visual Studio 2017 to run the application. (ASP.NET MVC)

How can I make another computer connect the same url address: 192.XXXXXXXXXXX:56987.

That is: 2 computers working at the same address, where I can debug the computer A and B.

I have 2 computers connected to the same wifi network.

1 - Attempt:

I already went to the Windows firewall configuration > I added new rule ... (New port configured).

And I still get the following error:

Bad Request - Invalid Hostname

HTTP Error 400. The request hostname is invalid.

2 - Attempt:

Start Menu > ISS > Website Associations > New port and IP.

Same problem. " Bad Request - Invalid Hostname ..."

3 - Attempt:

I’ve tried to put http://192.XXX.XX.XXX:56987/

4 - Attempt:

I have tried the colleague’s reply Rovann Linhalis. The problem remains the same.

5 - Attempt:

I tried my colleague’s answer Gypsy Morrison Mendez, the problem changed.

Now it is no longer "Bad Request - Invalid Hostname ...". Now it is:

Service Unavailable HTTP Error 503.

The service is unavailable.

Some solution ?

  • how to use the same localhost? explain your goal better so I can help you

  • 1

    Localhost is just the local nickname of each machine. Use the IP of the machine on the network to access. If it doesn’t work, it can be the firewall of the server (or network) blocking.

  • So: The computer "A" has visual studio installed and ISS, computer "B" has nothing, has only one browser. How to make computer "B" with the same network as "A".

  • @bfavaretto, Voce have any link or tutorial ? I’m novice at these network things.

  • Connect the 2 on the same router and see what is the IP of each of them. I have no tutorial to recommend, but should have several on google.

  • Your application runs on a browser using localhost and you want to access the work directory on another computer is this?

  • That @Felipeduarte.

  • You’re remembering to put the protocol? http:// IP:porta, and not only IP:porta? depending on the environment it makes a difference.

  • @Bacco, yes I’ve tried tbm, the problem is the same

  • Did you see if your router has an option to 'isolate wireless clients' or something? It has a router that does not allow communication between wireless pairs. Test with a network crossover cable between the 2 pcs, if you can, to see if this is not it (but then you would need to manually IP). Or cable testing, even with the router.

  • Well thought, I’ll try here.

  • I talked to Matheus on chat, and it’s really weird... on the same computer that runs the localhost:port url, it doesn’t work 127.0.0.1:port even with the machine name

  • Everyone, thank you for taking the time to help me solve the problem. The problem was solved with the answer of fellow Gypsy Morrison Mendez. Thanks staff.

Show 8 more comments

2 answers

5

Whereas the two computers are already on the same network:

1-Discover the IP of your computer A:

open a command prompt, the famous cmd, and type ipconfig. You will see this screen:

Ipconfig

Your address will be on "IPV4 address" in my case, 192.168.25.50

2-Discover the TCP port used by ISS, you can look directly at the url opened by visual studio when you start the project:

url

In my case, 2143, in case I don’t have an informed door (http://[host]:[port]/[...]) will be adopted the standard HTTP port, which is 80.

3-Release the port (if necessary) in the windows firewall:

Control Panel > Windows Firewall > Advanced Settings > Input Rules > New Rule > Port > TCP | Specific local ports [enter your port] > Allow Connection > All options > NAME your rule > Finish.

4-In the browser of the computer B, type the same url that the visual studio opens for you by replacing the Host part with the IP of the computer A.

EX:

To: http://localhost:2143/Default.aspx

B: http://192.168.25.50:2143/Default.aspx

  • 1

    I complemented the reply, I was still writing rsrs

  • not... on the computer firewall A

  • disables computer firewall A for testing

  • The visual studio on the computer A, is running the project right ?

  • which are the respective ips of the A / B computers

  • Rovan Linhalis, which way is the Hots? That suspect ...

  • 1

    c: windows system32 drivers etc hosts

  • Thank you for helping me. :)

Show 3 more comments

5


You must also allow the use of the address specifically for the IIS Express case by running the following in administrator mode:

> netsh http add urlacl url=http://192.168.25.50:56987 user=everyone

Note that this is not a configuration of firewall. It’s a user-based permissioning.


Having had a 503 error, some more things need to be done:

  1. Open your file applicationhost.config file. Usually it is in C:\Users\SeuUsuario\Documents\IISExpress\config\applicationhost.config or in Diretório da Solução\.vs\config\applicationhost.config (in the case of VS2015);
  2. Locate your website entry in the file and add the following:

    <binding protocol="http" bindingInformation=":56987:nomedasuamaquina" />
    
  3. Restart the IIS Express.

  • Windows in English, right? Use user=Todos in place.

  • That’s weird. Are you sure you’re using the right Wi-Fi network IP to do the command?

  • After a long time, netsh http add urlacl url=http://192.168.25.50:56987/ user=Todos just add / at the end number. The problem has changed. Now it is: Service Unavailable

  • 1

    @Matheusmiranda I put more details.

  • Gypsy saved my day, thank you :)

  • I just don’t understand why people want to close my question ...

  • Add me to Facebook I’ll explain to you why.

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.