Here is an example code to create a basic HTTP server with a Connect style route in C#:
main.cs1229 chars45 lines
In this example, we are creating a HTTPListener object to listen to requests on the URL "http://localhost:8080/". We then loop indefinitely, waiting for incoming requests. When a request arrives, we check its URL path to determine which message to return. Finally, we construct a response with the message, write it to the response stream, and close the output and response streams.
gistlibby LogSnag