Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTP Error 400 - OWIN with Topshelf

Tags:

.net

asp.net

I've created a windows service using Owin and topshelf.
the application is a WebAPI that listens on port 9000 and I have allowed this port in my firewall rules.
when I executed the .exe file on windows server 2008 I can use it locally(localhost:9000)
but when I try to access it from other machines, I get this error message:

HTTP Error 400. The request hostname is invalid

what am I missing? please help.

like image 575
Mohsen Shakiba Avatar asked Mar 05 '16 05:03

Mohsen Shakiba


1 Answers

this solved my problem, which might be super obvious to you, but not as much to me.
instead of using this code:

WebApp.Start("http://localhost:8080/");

I had to use this:

WebApp.Start("http://*:8080/");

of course one shouldn't forget to open the port in the firewall too.

like image 93
Mohsen Shakiba Avatar answered Nov 20 '22 08:11

Mohsen Shakiba