samedi 5 septembre 2020

HTTP Post request can be read by TPCListener but not HTTPListener C#

I'm currently trying to tinker with slack apps and I've run across a problem I just can't seem to find anything online about. I have the slack app setup to send out web requests to my local IP and port forward it to my machine. This all works great when I use a TCPListener. I just use generic code to create the listener on my local IP using the port I specified(2555 in this case). When the request gets sent from my slash command the listener receives the connection and reads the request. However when I try to do a similar situation with an HTTPListener the request never makes it to the listener as far as I can tell.

Some things to note that I have verified.

The firewall is not blocking connections from outside.

If I run a generic HTTPClient on the same machine and send a POST request out to the local listener it does receive it.

I have made sure that my Prefixes are allowing the correct URI's. To that end i've even for development purposes extended it to http://*:2555/

The code I'm using for the listener is pretty basic:

    HttpListener oListener = new HttpListener();
    oListener.Prefixes.Add("http://*:2555/");
    oListener.Start();
    HttpListenerContext context = oListener.GetContext();



Aucun commentaire:

Enregistrer un commentaire