Domanda

Same situation as this question, HttpListener not receiving remote requests, even with the firewall down and all prefixes registered, namely:

  • the HttpListener is only receiving requests from the same machine
  • the application is running on a Windows EC2 instance (same spec as the other question)
  • the ports being used are registered and opened in the firewall (I also temporarily took down the firewall to ensure that wasn't the issue)
  • The prefix I'm using is http://*:8080/

Differences from the other question:

  • The security groups of the EC2 are correctly configured
  • It was accepting outside requests, until (as far as I know) today and I'm not aware of any system changes (but I'm open to all ideas, whatsoever)

Additional info:

  • The EC2 instance and system is passing all status checks
  • I restarted the instance; no change
  • The http status code sent back (not from my server application, from the system) to a remote client is a 503 (service unavailable)
  • I've checked and rechecked that the url is correct (I have an elastic IP address and am using the public DNS of the instance in the url)
  • I ran netstat to make sure the port was not being used by other processes

Any ideas for things to check or try are completely welcome; I've pretty much run out of ideas...

È stato utile?

Soluzione

Couple of thoughts, some you've likely already checked:

  • Make sure you can still hit the listener locally on the machine - just to factor out something wrong with the code iteself

  • Make sure there is nothing else running on that port on that machine

  • Check the event viewer - any errors in there that may apply? Other events? A recent Windows Update - anything?

  • Try another port - to rule out port conflicts, try a different one

  • Make sure you are bound to the prefix: http://*:{your-port-#-here}/ - also, when you make your call HttpListener can be very specific, if you include a trailing slash in the prefix you register make sure you include that in your call, etc.

  • When you try to hit the machine - what address are you using: an EC2 Elastic IP address, the EC2 public dns, some DNS name you have routed to that machine? I have seen EC2 machines change public IP/DNS after a reboot before, maybe yours has changed?

That's all I can think of for now. Good luck.

Altri suggerimenti

If you have more than one urlacl on the same port, e.g. like:

$ netsh http show urlacl

Reserved URL            : http://+:8080/
    User: PUBEN\myself
        Listen: Yes
        Delegate: No
        SDDL: D:(A;;GX;;;S-1-5-21-436374069-1547161642-1177238915-5114)

Reserved URL            : http://192.168.47.120:8080/
    User: \Everyone
        Listen: Yes
        Delegate: No
        SDDL: D:(A;;GX;;;WD)

Reserved URL            : http://127.0.0.1:8080/
    User: \Everyone
        Listen: Yes
        Delegate: No
        SDDL: D:(A;;GX;;;WD)

You will get ServiceUnavailable due to the first reservation in the list. To fix,

netsh http delete urlacl url=http://+:8080/

Or just use Suave.io and save yourself the headache.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top