Closed eguvenc closed 2 months ago
Listen for error event, you can even change the header by changing the property value
I tried to listen error event, it always come null even if connection closed
thanks, it works fine.
eventSource.onerror = function (event) {
if (event.status == 401) {
}
};
Every request i send a JWT token at headers. When the connection is closed with 401 reason i want to recreate the EventSource object with new token.
Is there any way to detect connection is open or not ?