Websocket with Caddy #4276

Closed
opened 2026-03-07 19:37:46 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @yodaphone on GitHub (Mar 5, 2020).

I have setup bitwarden with Caddy reverse proxy. I'm running it with port 8088 and with caddy it works great with ACME LE Certs.

All these are behind a pfsense firewall

I then enabled WEBSOCKETS & opened up the port in pfsense

this my Caddy v1 Caddyfile

bitwarden.domain.com {
  tls {
    dns cloudflare
    wildcard
  }

  proxy / 192.168.10.74:8088 {
    transparent
  }
  proxy /notifications/hub/negotiate 192.168.10.74:8088 {
    transparent
  }
  proxy /notifications/hub 192.168.10.74:3012 {
    websocket
  }
 gzip
}

Livesync doesnt work with this setup. any change i make in app is not synced unless i referesh the page in another session OR client

My docker compose is

# bitwarden
version: '3'

services:
 bitwarden:
  image: bitwardenrs/server:alpine
  container_name: bitwarden
  restart: always
  volumes:
      - /opt/bitwarden/data:/data/
  ports:
    - 8088:80
  environment:
    LOG_FILE: '/opt/bitwarden/bitwarden.log'
    LOG_LEVEL: 'debug'
    EXTENDED_LOGGING: 'true'
    WEB_VAULT_ENABLED: 'true'
    WEBSOCKET_ENABLED: 'true'
    WEBSOCKET_PORT: '3012'
    ADMIN_TOKEN: 'XXXXXXXXXXXXXXXXXXXXXXXX'
    SIGNUPS_ALLOWED: 'true'

this is what i see in the errors log on the caddy server

[ERROR 502 /notifications/hub] dial tcp 192.168.10.74:3012: connect: connection refused

Originally created by @yodaphone on GitHub (Mar 5, 2020). I have setup bitwarden with Caddy reverse proxy. I'm running it with port 8088 and with caddy it works great with ACME LE Certs. All these are behind a pfsense firewall I then enabled WEBSOCKETS & opened up the port in pfsense this my Caddy v1 Caddyfile ``` bitwarden.domain.com { tls { dns cloudflare wildcard } proxy / 192.168.10.74:8088 { transparent } proxy /notifications/hub/negotiate 192.168.10.74:8088 { transparent } proxy /notifications/hub 192.168.10.74:3012 { websocket } gzip } ``` Livesync doesnt work with this setup. any change i make in app is not synced unless i referesh the page in another session OR client My docker compose is ``` # bitwarden version: '3' services: bitwarden: image: bitwardenrs/server:alpine container_name: bitwarden restart: always volumes: - /opt/bitwarden/data:/data/ ports: - 8088:80 environment: LOG_FILE: '/opt/bitwarden/bitwarden.log' LOG_LEVEL: 'debug' EXTENDED_LOGGING: 'true' WEB_VAULT_ENABLED: 'true' WEBSOCKET_ENABLED: 'true' WEBSOCKET_PORT: '3012' ADMIN_TOKEN: 'XXXXXXXXXXXXXXXXXXXXXXXX' SIGNUPS_ALLOWED: 'true' ``` this is what i see in the errors log on the caddy server `[ERROR 502 /notifications/hub] dial tcp 192.168.10.74:3012: connect: connection refused`
Author
Owner

@yodaphone commented on GitHub (Mar 5, 2020):

it was a stupid mistake on my part.. forgot to open ports in my docker compose

@yodaphone commented on GitHub (Mar 5, 2020): it was a stupid mistake on my part.. forgot to open ports in my docker compose
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vaultwarden#4276