Websocket

HTTP listener that transparently proxies WebSocket upgrade requests

Category: Practical
Task: HTTP listener that transparently proxies WebSocket upgrade requests

Prerequisites: The product runtime and any backend services referenced by this configuration.

Run it: Use ghcr.io/praxis-proxy/praxis:0.7.2 and follow the first reverse-proxy tutorial to mount and start the configuration.

This configuration comes from the selected release. The example has not been run here; external services are not bundled.

Download the source file.

# WebSocket Proxy
#
# HTTP listener that transparently proxies WebSocket upgrade
# requests. Pingora detects the Upgrade handshake and switches
# to bidirectional byte forwarding after the 101 response.
# No special configuration is needed; any HTTP listener that
# routes to a WebSocket-capable upstream will proxy upgrades.
#
#   Client -> WS -> Praxis :8080 -> WS -> Backend :3000
#
listeners:
  - name: web
    address: "127.0.0.1:8080"
    filter_chains: [ main ]

filter_chains:
  - name: main
    filters:
      - filter: request_id
      - filter: access_log
      - filter: router
        routes:
          - path_prefix: "/"
            cluster: backend
      - filter: load_balancer
        clusters:
          - name: backend
            endpoints:
              - "127.0.0.1:3000"

insecure_options:
  allow_private_endpoints: true # example proxies to local backends