Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caddy container continuously restarting, error in caddyfile? #7

Open
jrjdavidson opened this issue Jun 12, 2024 · 6 comments
Open

Caddy container continuously restarting, error in caddyfile? #7

jrjdavidson opened this issue Jun 12, 2024 · 6 comments

Comments

@jrjdavidson
Copy link

Kia ora,
I used the setup as described in 5.1 and got the following error. Switching protocol to http:// as suggested seems to fix the issue

Error: adapting config using caddyfile: parsing caddyfile tokens for 'reverse_proxy': parsing upstream 'ws://mqtt5:9001': the scheme ws:// is only supported in browsers; use http:// instead, at /etc/caddy/Caddyfile:2

Thanks for that write up!

@sukesh-ak
Copy link
Owner

sukesh-ak commented Jun 13, 2024

@jrjdavidson
Not too sure. I have it working the exact way mentioned on my Ubuntu server on Azure.

Use the mqttx client to test and use wss:// to connect and use port 433 from outside.
Caddy should take that secured websocket request (since its wss) and forward it to local ws endpoint.

image

@jrjdavidson
Copy link
Author

That is unexpected, I tested this on a fresh Ubuntu 22 machine on azure and got that error. This error caused the caddy container to restart continuously. Once I changed the caddy file to http:// instead of ws://, the container started without a hitch. And yes, I was able to connect to the server using the wss protocol once I changed the caddyfile.
Might be worth making a note of it in the writeup? Or leave this open?

@jrjdavidson jrjdavidson changed the title error in caddyfile? Caddy contained continusouly restarting, error in caddyfile? Jun 13, 2024
@jrjdavidson jrjdavidson changed the title Caddy contained continusouly restarting, error in caddyfile? Caddy container continuously restarting, error in caddyfile? Jun 13, 2024
@sukesh-ak
Copy link
Owner

sukesh-ak commented Jun 14, 2024

Will clean up and redo again on my end, once I get time. Till then will keep this open.

Thanks for the update.

@sukesh-ak
Copy link
Owner

@jrjdavidson
What client were you using for testing?

@jrjdavidson
Copy link
Author

desktop mqttx
https://mqttx.app/

@sukesh-ak
Copy link
Owner

desktop mqttx https://mqttx.app/

For websocket test, use web version and see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants