Domanda

My c# httplistener only catches requests when i send them in the local network (from machines on the same wifi using the local area ip).

When I look my public ip (with "my ip" in google) and type in get requests through that url, i get no responses and my events dont trigger in visual studio

I prefixed it correctly listener.Prefixes.Add("http://*:2999/"); and set Access control header, it works perfectly through local url requests, just not public

Also, there are many questions about it not working outside host machine, mine does, just not outside local network because the public ip gets no response

EDIT: Is there a way to do this without having to do stuff on the router? I'm on a college network and dont have access to router port settings

È stato utile?

Soluzione

You need to forward port 2999 from your router's WAN side to your server. This procedure is manufacturer specific and easily searched for on the web.

Altri suggerimenti

C # HttpListener worked for me (with the correct port forwarding) on the local computer or local network (Windows7). If i access the Internet in response HttpListener always gave an error 50 * may have a ban but I do not know where it is configured. I had to use TcpListener and manually parse HTTP-requests.

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