Caddy Websocket Reverse Proxy connections

Hello everyone,

I have a question regarding the inner workings of Caddy. I want to have one reverse proxy server that proxies websocket connections across multiple nodes. I was wondering how Caddy handles this with the proxy serving as the middle man?

Does the proxy open a websocket connection with the client, and then another one with the backend server, then forwards messages between the two? Or how does this work?

Correct - Caddy terminates the HTTP transport, and initiates a new transport with the backend. It shuttles bytes between the two once the WS transport is established.

1 Like