hhxsv5 / php-sse

A simple and efficient library implemented HTML5's server-sent events by PHP, is used to real-time push events from server to client, and easier than Websocket, instead of AJAX request.
MIT License
426 stars 49 forks source link

Close the Connection. #10

Closed lbassuncao closed 4 years ago

lbassuncao commented 4 years ago

How do I close the connection from client?

hhxsv5 commented 4 years ago
const source = new EventSource('http://127.0.0.1:9001/push.php', {withCredentials:true});
source.close(); // disconnect stream