Can I somehow, by running httpListener with the prefix " http: // +: 8080 ", then send a request to it? Or unicode characters can not be used in the host?

  • one
    Uh, what do you mean by "Unicode characters"? - VladD
  • Probably not put it that way. I created and launched httplistener with the prefix "http: // +: 8080", and the whole question is that I cannot send a request to it, because WebClient says that it cannot recognize the host name, apparently this is the host name "+" for it is not valid. And my question is, is it even possible to make it work? - Okama

2 answers 2

+, means that it can receive requests from any IP, and in WebCliente you must specify the IP and port of the server (in your case httplistener)

  • Faster + means that the listener will accept all requests on this port, regardless of other prefixes, unlike * when requests are received, if the URI does not match other prefixes. So it is not necessary to specify exactly IP - Primus Singularis
  • @PrimusSingularis yes it is, you are right. I decided that my answer would be clear to the author and he is consistent. - Yury Bakharev

Yes, when prompted, the host name http: // +: 8080 is not valid, since + is not a name, but a special character, meaning that HttpListener accepts all requests to port 8080 for any URI, i.e. for HttpListener, this is a valid string, but not for the client. When prompted, you need to specify the name of the host on which the listener is running, if running on a local network, you can specify the IP address or the name of the machine ( http://192.168.xxx.xxx:8080/ ), if from the same machine, localhost ( http : // localhost: 8080 )