Skip to content

Express: SSE not working #41

Closed
Closed

Description

@x7airworker

Using the following code, the connection can be opened, but no data gets sended:

app.get('/stream', (req, res) => {
    res.setHeader('Cache-Control', 'no-cache');
    res.setHeader('Content-Type', 'text/event-stream');
    res.setHeader('Connection', 'keep-alive');
    res.flushHeaders();
    
    res.write("data: Hello World!\n\n");
})

With res.end() I am able to close to connection and send all messages at once.
This issue could also be related to #22.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions