For this caddy config, I am getting e URL like this ââ http://name.website.com "
But I want to create a WebSocket URL like this ââ wss://name.website.com ââ. So, that I can use this URL to connect with my WebSocket server.
Please help me to properly set up a WebSocket on Caddy and create a WebSocket protocol URL.
WebSocket upgrades are automatic. Remove all the @websocket stuff in your config (it isnât being used anyway) and just have your client connect with wss:// and it will be proxied to your backend as a websocket.
but if I make these changes, I am still getting some errors like in my client I try to connect the socket through - http://name.website.com
I am getting this error -
wss means âWebsockets over HTTPSâ. You only configured Caddy to listen for HTTP, not HTTPS (because of http://). So you need to use ws:// for now until you enable HTTPS.