Change source (url) of Server-Sent event
How can I change the source set in declaration of EventSource ? I have tried something like this: var source = new EventSource("/blahblah.php?path=" + (window.location.pathname)); // Few lines later... source.url = "/blahblah.php?path=" + url; But, source.url stays the same... Is this even possible? Or maybe there are alternative ways to do that? No, it is not possible. A new URL passed to EventSource() creates a new EventSource object. guest271314 suggested me much solutions to this, but for me it would be much better, faster and less complicated to stay with sse. I changed the source by