Skip to content

[Bug]: Soketi (coolify-realtime) binds IPv4-only, causing WebSocket failures when localhost resolves to IPv6 #8584

Description

@jacocanete

Error Message and Logs

When connecting to Coolify's realtime WebSocket server (Soketi on port 6001) via any client that resolves localhost to [::1] (IPv6), the connection is refused or reset.

cloudflared logs:
ERR error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: read tcp [::1]:50328->[::1]:6001:read: connection reset by peer"
ERR Request failed error="Unable to reach the origin service..." dest=https://realtime.jacocanete.dev/app/... type=ws

Root cause — netstat inside the coolify-realtime container:
Proto Local Address State PID/Program
tcp 0.0.0.0:6001 LISTEN soketi-server ← IPv4 only
tcp :::6002 LISTEN node ← IPv4 + IPv6 (dual-stack)

Soketi binds to 0.0.0.0:6001 (IPv4 only) because its default host option is "0.0.0.0". The terminal server on port 6002 uses Node.js server.listen(6002) which defaults to :: (dual-stack). This inconsistency means any client resolving localhost to [::1] can reach the terminal server but not Soketi.

Steps to Reproduce

  1. Deploy Coolify on a Linux host with IPv6 enabled (default on most distros)
  2. Set up any reverse proxy or tunnel that connects to localhost:6001 (e.g., Cloudflare Tunnel / cloudflared)
  3. The proxy resolves localhost to [::1] (standard Go/modern resolver behavior)
  4. WebSocket connections to Soketi fail with connection reset; terminal WebSocket on port 6002 works fine

Verification:
# Inside the coolify-realtime container:
netstat -tlnp
# Shows 0.0.0.0:6001 (Soketi, IPv4 only) vs :::6002 (terminal, dual-stack)

Fix: Adding SOKETI_HOST: "::" to the soketi service environment in docker-compose.prod.yml makes Soketi bind dual-stack, matching the terminal server. Verified this works — Soketi correctly listens on :::6001 with the env var set.

Example Repository URL

No response

Coolify Version

v4.0.0-beta.401

Are you using Coolify Cloud?

No (self-hosted)

Operating System and Version (self-hosted)

Debian 13

Additional Information

The proposed fix is a one-line change in docker-compose.prod.yml:

soketi:
 environment:
    SOKETI_HOST: ":"

The work around was forcing IPv4 in the Cloudflare Tunnel route from localhost:6001 as per the docs to http://127.0.0.1:6001.

I'd love to contribute a PR for this myself if a maintainer can validate that my proposed fix is the correct approach.

Looking forward!

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔍 TriageIssues that need assessment and prioritization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions