I have a symfony / api PLatform server. I added Mercure to send SSE to API clients. On my client side I subscribe using event Source Polyfill.
I manage to receive the messages, but I have the following error :
Error: No activity within 45000 milliseconds. 2 chars received. Reconnecting.
I read that a heartbeat was needed to kieep connection alive and avoid this error.
I then added the heartbeat instruction to the hub command line :
SERVER_NAME=:3000 MERCURE_PUBLISHER_JWT_KEY='toto' MERCURE_SUBSCRIBER_JWT_KEY=$(cat ../config/jwt/public.pem) MERCURE_SUBSCRIBER_JWT_ALG=RS256 HEARTBEAT_INTERVAL=15s READ_TIMEOUT=2m ./mercure run -config Caddyfile.dev
but nothing changed. I still have this error.
What did I miss?
thank you for your help