How to run OwinHost from ip address not localhost without IIS

2,528 views
Skip to first unread message

Julian Bright

unread,
Jun 28, 2013, 8:40:10 AM6/28/13
to net-http-a...@googlegroups.com
Hi,

I have OwinHost running my WebApi controller, and am able to hit it here: http://localhost:5000/api/values/1

But when I try to hit the same location via an IP address eg: http://127.0.0.1:5000/api/values/1

I get a response of HTTP Error 400 Bad Request - Invalid Hostname.

Is OwinHost supported to run with an IP address, or does it need to be within a container such as IIS?

Thanks,
Julian.

Chris R

unread,
Jul 13, 2013, 11:09:12 AM7/13/13
to net-http-a...@googlegroups.com
Http.Sys is very specific about addresses.  When you send a request to 127.0.0.1 that shows up in the Host header too.  Http.Sys is complaining that your Host header does not match the given host localhost.  You can loosen it by giving it both urls or by specifying http://*:5000 or http://+:5000.


Date: Fri, 28 Jun 2013 05:40:10 -0700
From: brigh...@gmail.com
To: net-http-a...@googlegroups.com
Subject: How to run OwinHost from ip address not localhost without IIS
--
You received this message because you are subscribed to the Google Groups ".NET HTTP Abstractions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to net-http-abstrac...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply all
Reply to author
Forward
0 new messages