I have an endpoint which generates serversent events and I used to read it in my client. But recently they enforced the same-origin policy and I get the error No 'Access-Control-Allow-Origin' header is present on the requested resource.
Is there a way to read these server sent events in a php proxy and echo it in my own event service stream?
Can you change the endpoint? To make it generate the required header?
header('Access-Control-Allow-Origin: *');
Alternatively a "php proxy" could work, you can use CURL to load the remote data, then echo it back out adding the header as above.
Be aware that allowing all origins isn't a good idea, and you should instead send a list of trusted domains.