Background: I downloaded .NET Core & Visual Studio code to my Mac, created a new MVC template project, and ran it. I can access it from my own computer at localhost:5000
. However another computer on my network cannot access it at [my ip address]:5000
.
Is there any way at all to host the site on my Mac so other local computers can access?
Yes, you can serve ASP.NET Core web sites from MacOS. I've done so myself.
Your problem is that you're attempting to serve from localhost
to another computer. localhost
, the special address 127.0.0.1
(on IPv4) is only meant for connections within your computer. You may have seen other software that acts differently, but if you've configured a server to use localhost
, it's expected that no other machine will be able to connect to it.
If you want to accept connections from any address, use the special address 0.0.0.0
instead. This tells the software to accept connections on any address/network interface that it can see.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With