Reverse Proxy for Web Sockets (WSS)

Hi,
Project GitHub URL

I have just started using caddy. I have made a simple chat application which I am serving using caddy.
The WebSockets are served on ws instead of wss by the application, similar to how the application is served on HTTP and not https, by the application.
I am trying to secure the protocols using caddy and have successfully done that for https. Since I wouldn’t be able to use ws when I am using https, I would need to serve the WebSockets on wss as well.
I couldn’t find a way in the docs where I can find how to reverse proxy wss to ws as I did with https to http.

What I tried

your.tld.com {
    proxy / 0.0.0.0:8266 {
        transparent
        websocket
    }
}

your.tld.com {
    proxy / 0.0.0.0:8266 {
        transparent
    }
   proxy /ws 0.0.0.0:8266 {
        transparent
    }
}

your.tld.com {
    proxy / 0.0.0.0:8266 {
        transparent
    }
   proxy /ws 0.0.0.0:8266/ws {
        transparent
    }
}

The above attemots did not work. Hopefully will get a solution here.

See the git discussion here: https://github.com/mholt/caddy/pull/1781

I think there’s some issue with websockets are handled on for a few programs, should see a new update soon™. Maybe that will fix it.