D
D
Dmitry Afonchenko2018-11-28 13:04:47
ASP.NET
Dmitry Afonchenko, 2018-11-28 13:04:47

How to make ASP.NET Core API available to computers on local network?

Good afternoon, comrades! The following question arose:
All events occur in Windows 10
1) I deploy the API on ASP.NET Core on a computer that is connected to the router via wi-fi.
2) It runs on the port https://localhost:5003 and is accessible from the same computer
3) On this computer, I enter the address https://localhost:5003 in
netsh http add urlacl url= https://localhost:5003 user=All (Russian version, so Everyone)
4) I disable the NOD32 firewall on all computers
5) I'm trying to reach the API from a computer that is connected by wire to the same router by wire. In response, silence.
What did not do:
netsh firewall add portopening TCP 5003 IISExpressWeb enable ALL
But I have Kestrel so I don't know if I need to do this or not.
What am I missing? Thank you all in advance for your replies!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shai_hulud, 2018-11-28
@Indermove

localhost binds 127.0.0.1 (IPv4) and [::1] (IPv6), and both of these addresses are occupied by a virtual loopback network interface , which can only be reached from the machine on which it is raised (i.e. only locally).
Of the options you have:
a) Proxy localhost:5003 to the external IP address of the machine
b) Bind not this address to the external address of the machine. The external address can be found through:

ipconfig -all

c) Bind all machine addresses through 0.0.0.0:5003 or if this is a wrapper for http.sys , then http://+:5003

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question