Search code examples
.nethttphttplistenerhttplistenerrequest

How to be sure a http request is local when using HttpListener


I'm using HttpListener. However, I only want to process requests that come locally, not from another machine/server.

How would I programmatically verify if an incoming request is local for sure? Would I need to use some of the HttpListenerRequest members?


Solution

  • Check with RemoteEndPoint property if the remote address of the request equals 127.0.0.1.