|
|
|
|
|
by tytho
1593 days ago
|
|
You cannot send custom headers when using the built-in EventSource[1] constructor, however you can pass the ‘include’ value to the credentials option. Many polyfills allow custom headers. However you are correct that if you’re not using JavaScript and connecting directly to the SSE endpoint via something else besides a browser client, nothing is preventing anyone from using custom headers. [1] https://developer.mozilla.org/en-US/docs/Web/API/EventSource... |
|
In my example I use this code: