1. Caddy version (caddy version
):
v2.4.5 h1:P1mRs6V2cMcagSPn+NWpD+OEYUYLIf6ecOa48cFGeUg=
2. How I run Caddy:
docker-compose caddy
caddy run --config /etc/caddy/Caddyfile --adapter caddyfile
a. System environment:
Debian 10.10 Container on a proxmox server with Docker 18.09.1, build 4c52b90
b. Command:
caddy run --config /etc/caddy/Caddyfile --adapter caddyfile
c. Service/unit/compose file:
FROM caddy:2.4.5-builder AS builder
RUN xcaddy build --with github.com/caddy-dns/cloudflare
FROM caddy:2.4.5
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
d. My complete Caddyfile or JSON config:
rpi.domaincom {
reverse_proxy http://192.168.137.5:8080
}
3. The problem I’m having:
I have a rpi4 running kodi with the webinterface active, i would like to access it through https://rpi.domaincom which loads fine but the websocket fails with:
WebSocket connection to ‘wss://rpi.domaincom:9090/jsonrpc?kodi’ failed
when attempting to access it directly from the browser i get the following error message:
ERR_DISALLOWED_URL_SCHEME
However, the websocket seems to work fine if i access it from http://192.168.137.5:8080
5. What I already tried:
I tried specifying the IP address in the webinterface settings to bypass the reverse proxy but i believe it detects the interface loading from https and redirects the websocket requests to wss (secure).
I tried the following configs:
rpi.domaincom:9090 {
reverse_proxy ws://192.168.137.5:9090 {
transport http {
tls_insecure_skip_verify
}
}
}
No errors from this one.
tried:
rpi.domaincom {
reverse_proxy /jsonrpc ws://192.168.137.5:9090
reverse_proxy http://192.168.137.5:8080
}
This generates the following errors:
2021/10/04 15:01:06.318 ERROR http.handlers.reverse_proxy aborting with incomplete response {"error": "context canceled"}
I’ve only recently started working with Caddy and i’m also not familiar with websockets, is it possible to attach a certificate to the websocket since it’s being called from the js within the https connection, i suspect the SSL would prevent any security policies enforced by the browser much like http elements being called in a https page url.