Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Traefik v2 vs v3 - SSE with gzip Compression Issue

This is a minimal reproduction case for the Server-Sent Events (SSE) compression issue in Traefik v3. The issue occurs when gzip compression is enabled and the server keeps the SSE connection open.

The Issue

In Traefik v3, when gzip compression is enabled, SSE events are not delivered to the client until the server closes the connection. This differs from Traefik v2 behavior where events are delivered immediately, regardless of connection state.

Setup

The project consists of:

  • A Node.js application that provides two SSE endpoints:
    • /events/keep-open - Server sends event and keeps connection open
    • /events/auto-close - Server sends event and closes connection
  • A web UI that demonstrates four scenarios:
    • Traefik v2 with client-side close
    • Traefik v2 with server-side close
    • Traefik v3 with client-side close
    • Traefik v3 with server-side close
  • Docker Compose configuration running both Traefik versions side by side

Usage

  1. Start the stack:
docker compose up --build
  1. Open http://localhost:3000 in your browser to access the test UI through Traefik v2

  2. Test different scenarios:

    • Client-side Close: Server keeps connection open, client must close it
    • Server-side Close: Server closes connection after sending event

Expected Behavior

Traefik v2

  • Both client-side and server-side close scenarios work correctly
  • Events are delivered immediately
  • Compression works without affecting event delivery

Traefik v3

  • Server-side close works correctly
  • Client-side close scenario fails to deliver events until connection is closed
  • This appears to be related to how Traefik v3 handles compression buffers with SSE

Accessing Traefik Dashboards

Technical Details

  • Both Traefik instances have gzip compression enabled
  • The Node.js server adds a 200ms delay before sending events to simulate real-world conditions
  • The UI shows exact timestamps of events and connection states
  • All scenarios use the same event payload size for consistent testing

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages