This is a simple web server implementation that can be used to test YARP proxy, by using it as the destination.
Functionality in this sample server includes:
Provided that the request URI path doesn't match other endpoints described below, then the request headers will be reported back as text in the response body. This enables you to quickly see what headers were sent, for example to analyze header transforms made by the reverse proxy.
HealthController implements an API endpoint for /api/health that will randomly return bad health status.
WebSocketsController implements an endpoint for testing web sockets at /api/websockets.
To run the sample server use:
dotnet runfrom the sample folderdotnet run SampleServer/SampleServer.csprojpassing in the path to the .csproj file- Build an executable using
dotnet build SampleServer.csprojand then run the executable directly
The server will listen to http://localhost:5000 and https://localhost:5001 by default. The ports and interface can be changed using the urls option on the cmd line. For example dotnet run SampleServer/SampleServer.csproj --urls "https://localhost:10000;http://localhost:10010"