npm install
npm run dev
A one-way connection, the server sending data to the client.
Server/Response sends the ‘text’ through the headers to client
Node JS Example:
app.use('/stream', (req, res) => {
res.setHeader('Content-Type', 'text/event-stream')
res.write('data: ' + '<ENTER_YOUR_DATA_TO_SEND>\n\n')
})
- HTTP 1 and/or HTTP 2
The server-sent event (browser) API is contained in the EventSource interface.