c# - HttpListener standalone app works on 2008, fails on 2012 -


i have standalone app uses httplistener works great on server 2008 fails miserably on 2012. each time attempt connect, variety of:

<!doctype html public "-//w3c//dtd html 4.01//en""http://www.w3.org/tr/html4/strict.dtd"> <html><head><title>bad request</title> <meta http-equiv="content-type" content="text/html; charset=us-ascii"></head> <body><h2>bad request - invalid hostname</h2> <hr><p>http error 400. request hostname invalid.</p> </body></html> 

when connect listener port command prompt on machine, works fine (i response expect).

the firewall configured correctly, , i've tried firewall disabled.

i've tried every possible combination of netsh http add urlacl imaginable, including:

http://+:n/ (n = port number) http://*:n/ http://127.0.0.1:n/ http://localhost:n/ http://public_ip_address:n/ 

i've tried accessing on each of hostnames, too.

also variety of user combinations:

user=everyone user=hostname\administrator 

i've tried them individually , tried without of them configured.

the result same response bounces between 503 , 400 (same response body above).

iis not running on machine. there no port conflicts. each machine has brand new installation app.

about rip hair off head.

apparently there things not made clear netsh http add urlacl , use of hard , soft wildcards "+" , "*".

i've solved issue, , appears happening this:

  • urlacl entries examined , compared against http host header
  • the + , * wildcards seem work ip addresses , names known machine
  • i.e. + , * wildcards not work public ip addresses or dns names not known machine

so, if have machine on local network , accessible through internet, may have set explicit urlacl entries public ip address , public dns names used.

really, annoying. hope saves time.


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -