[Magically solved?] Can't connect to HTTP websocket server behind HTTPS caddy proxy

So I have a simple echo websocket server (python) running on localhost:8080

jfault.duckdns.org {
    tls my.email@domain.com
    proxy / ws://localhost:8080 {
            header_upstream Connection {>Connection}
            header_upstream Upgrade {>Upgrade}
    log log.txt

However, I can’t seem to connect to wss://jfault.duckdns.org/. I don’t know if this is caddy or my websocket server but I can connect to ws://localhost:8080 fine from my own computer.

I’m starting caddy with caddy --conf=Caddyfile --http2=false (latest release (from website) and Windows 10)

Hey Jay, The header_upstream lines are redundant as the websocket preset will take care of that for you. Also, try taking out the ws:// prefix on the upstream… maybe replace it with https:// – can be hard to tell exactly what the fix is from this angle. :wink:

Hmm, the WS server isn’t ssl/tls though…

Oh, right, so replace ws:// with http://.

err, it seems it fixed itself, somehow

I didn’t even change anything just restarted caddy :joy:

Huh, well you do have to reload the configuration (either with SIGUSR1 or restarting Caddy) in order for it take effect. Glad it’s working for you. :slight_smile:

SIGUSR1? Is there a way to do that on Windows? :laughing:

Nope, sorry :-/

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.