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
}
}
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.
I have something like this is my config files :
proxy /api/v1/streaming http://localhost:4000 {
websocket
}
So for you it will be something like :
your.tld.com {
proxy / 0.0.0.0:8266 {
transparent
}
proxy /ws http://0.0.0.0:8266 {
websocket
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With