The proxy has over 80 settings, thankfully they all have sensible defaults. The two most important settings are the port that the proxy listens on and the backend list. We'll cover the backends later in the guides, but for the port the proxy listens on 8000. To use a different port, set the Port environment variable.
When running in Docker:
- The container's exposed port must match the value of
Port. - The host port can be any available port and does not need to match
Port.
This guide starts the proxy and verifies that it is accepting HTTP requests.
Run commands from the repository root and choose one local runtime.
- .NET 10 SDK for running from source.
- Docker for running the container image.
Run the .NET project from the repository root.
dotnet run --project src/SimpleL7Proxy/SimpleL7Proxy.csprojBuild the image with src as the Docker context, then publish the default port.
docker build --tag simplel7proxy:latest \
--file src/SimpleL7Proxy/Dockerfile src
docker run --publish 8000:8000 simplel7proxy:latestTo use a different proxy port, pass the same value to the container:
export Port=8080
docker run --env Port="${Port}" --publish "${Port}:${Port}" simplel7proxy:latestCall the health endpoints from a second terminal.
curl -i http://localhost:8000/liveness
curl -i http://localhost:8000/readiness/livenessreturns200 OKwhen the proxy process is running./readinessreturns503 Service Unavailableuntil an eligible backend is configured.
Press Ctrl+C in the first terminal to stop the proxy.
