Created
November 7, 2020 14:12
-
-
Save iamparnab/107bd4bb07ff00eddac150208f41a079 to your computer and use it in GitHub Desktop.
Sending different fields in SSE response body
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
response.write('data: First message\n'); | |
response.write('event: sampleEvent\n'); | |
response.write('id: 1\n'); | |
response.write('retry: 1000\n'); | |
response.write('\n\n'); // flush the message | |
response.write('data: Second message\n'); // start a new message | |
response.write('event: sampleEvent\n'); | |
response.write('id: 2\n'); | |
response.write('\n\n'); // flush the message |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment