Note: This feature is available in Web Workers.
The url read-only property of the EventSource interface returns a string representing the URL of the source.
A string representing the URL of the source.
const evtSource = new EventSource("sse.php");
console.log(evtSource.url);Note: You can find a full example on GitHub — see Simple SSE demo using PHP.