C
C#5mo ago
Dultus

Connecting to localhost API Server IP-address

I build this service:
builder.Services.AddHttpClient("ArticleAPI", client => // Injecten der HttpClientFactory
{
client.BaseAddress = new Uri(File.ReadAllText("ipaddress.json")+"/api/");
});
builder.Services.AddHttpClient("ArticleAPI", client => // Injecten der HttpClientFactory
{
client.BaseAddress = new Uri(File.ReadAllText("ipaddress.json")+"/api/");
});
Now, if there's http://localhost:5255 in this file, my application works. If I put in my local IP-Address http://192.168.178.22:5255 it doesn't work. HOWEVER; I tried to run the application on another PC. There it's the other way around. Localhost doesn't work but their own local IP address does. Any ideas?
1 Reply
Sossenbinder
Sossenbinder5mo ago
What does the server endpoint look like? Like, on which network interface does it listen?
Want results from more Discord servers?
Add your server