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
}
}
2)
your.tld.com {
proxy / 0.0.0.0:8266 {
transparent
}
proxy /ws 0.0.0.0:8266 {
transparent
}
}
3)
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.
reverse_proxy
– Dewy