Developing

Build from source

Build Praxis from source for local development, then route a request to an upstream backend.

Praxis v0.8.0 2 min read
On this page

  1. Quick Test Servers

    For rapid experimentation without building or configuring, use the xtask utilities:

    Echo server (static responses):

    cargo xtask echo
    curl http://127.0.0.1:8080/
    # {"status": "ok"}
    

    Customize responses:

    cargo xtask echo --status 201 --body '{"created": true}' --header "X-Custom: value"
    

    Debug server (run with dev settings):

    cargo xtask debug
    # Runs with debug logging, admin API on :9090, single-threaded
    

    Pass a config file:

    cargo xtask debug examples/configs/traffic-management/basic-reverse-proxy.yaml
    
  2. Build and Run

    Build the release binary:

    make release
    

    Start Praxis:

    ./target/release/praxis
    

    The server starts on 127.0.0.1:8080 with a built-in default configuration. Verify it:

    curl http://127.0.0.1:8080/
    
    {"status": "ok", "server": "praxis"}
    
  3. Proxy to a backend

    Create praxis.yaml:

    # The backend below is on loopback, which the SSRF endpoint check
    # rejects unless you opt in. Drop this block once your backends are
    # on real addresses.
    insecure_options:
      allow_private_endpoints: true
    
    listeners:
      - name: web
        address: "127.0.0.1:8080"
        filter_chains: [main]
    
    filter_chains:
      - name: main
        filters:
          - filter: router
            routes:
              - path_prefix: "/"
                cluster: backend
          - filter: load_balancer
            clusters:
              - name: backend
                endpoints:
                  - "127.0.0.1:3000"
    

    Note: Praxis rejects upstream endpoints that resolve to loopback, link-local, or cloud-metadata addresses by default, as an SSRF guard. insecure_options.allow_private_endpoints: true opts a config into using them — appropriate for local development, not for production configs pointing at real backends.

    Start Praxis with your config:

    ./target/release/praxis -c praxis.yaml
    

    Requests to port 8080 are now forwarded to your backend on port 3000:

    curl http://127.0.0.1:8080/
    
  4. Next steps