Caddy addon and mosquitto

I’ve installed the Caddy Proxy addon by bestlibre. I’m unable to configure the addon so it will forward traffic to mosquitto. Mosquitto works fine. If I set up port forwarding to go to the mosquitto server everything works fine. But if I create a vhost and have that foraward to mosquitto I’m unable to connect to the mosquitto server. Is there anyway to get the vhost to work?

Does anyone know if it will work with Nginx? I like Caddy because I don’t have to deal with another addon for Lets Encrypt, but if Nginx works, I’d be willing to change.

I haven’t gotten this far in my setup yet, but as I was researching caddy I saw your post and wondered if you resolved the problem?

I did find a minor hint of what might possibly be going on here: https://github.com/eclipse/mosquitto/issues/585

If that is the problem, this probably won’t solve it… but stumbled upon a different caddy plugin:

No, I never solved it. It wasn’t worth the effort. I’ve just continued to use port forwarding.

the problem is that MQTT isn’t an HTTP connection. It either uses web sockets ws:// or TCP direct connection tcp://. I don’t know that you can reverse proxy the tcp, but you can probably reverse proxy the websocket connection.