I have two local apps running:
- ASP.NET client (ASP.NET 4.8):
https://localhost:44300
- Duende Identity Server (.NET 6):
https://localhost:44349
The Identity Server cookies are being sent to the client application when the browser makes request to the client application.
Since this wouldn't happen in prod due to them being two different URLs, I tried this answer which says to use one as 127.0.0.1
, and the other as localhost
, in order to replicate how the cookies would be sent in prod.
However, when I try to access https://127.0.0.1:44300
, I get Bad Request - Invalid Hostname
.
I've checked C:\Windows\System32\drivers\etc\hosts
and can see it has these two lines:
127.0.0.1 localhost
::1 localhost
I've also tried the suggestions in this answer, but it didn't work.
How can I access localhost
using 127.0.0.1
?