Closed jufmejiagu closed 8 years ago
The EventSource specification itself does not describe adding custom headers.
For things like cookies, http-auth, or CORS, EventSource will transparently use those like any other HTTP request for the given server. (CORS support was missing in the early days but all evergreen browsers that support EventSource should also support CORS now.) Sometimes that means you must first make a non-EventSource connection to that server before making the EventSource connection.
For truly custom behavior the usual approach is to pass that info via a query string in the URL; of course this requires server-side support.
Yes, i used the query string in the URL. But we were looking for another way to do... Thanks.
Hi.
I try to set the header in a fromEventSource for a lot of hours... I could not do it. If this it's possible, we need more documentation... If not it's possible, It would be very interesting to do for security reasons. Event source not have API from http headers, it is possible?
Thanks!!