{"id":18073868,"url":"https://github.com/niels-nijens/cloudflared-sse-test","last_synced_at":"2026-05-03T23:32:19.801Z","repository":{"id":72783413,"uuid":"235554986","full_name":"niels-nijens/cloudflared-sse-test","owner":"niels-nijens","description":"Test the behavior of a PHP-based Server-Sent Events stream with the Cloudflare Argo tunnel.","archived":false,"fork":false,"pushed_at":"2020-01-22T16:03:11.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-25T20:04:49.969Z","etag":null,"topics":["cloudflare","cloudflared","docker","php","server-sent-events","sse"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/niels-nijens.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-22T11:01:09.000Z","updated_at":"2020-01-22T16:03:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"51eba375-f75a-403a-9863-ec53d6d881db","html_url":"https://github.com/niels-nijens/cloudflared-sse-test","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/niels-nijens/cloudflared-sse-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niels-nijens%2Fcloudflared-sse-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niels-nijens%2Fcloudflared-sse-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niels-nijens%2Fcloudflared-sse-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niels-nijens%2Fcloudflared-sse-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niels-nijens","download_url":"https://codeload.github.com/niels-nijens/cloudflared-sse-test/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niels-nijens%2Fcloudflared-sse-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32589109,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"ssl_error","status_checked_at":"2026-05-03T22:09:10.534Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudflare","cloudflared","docker","php","server-sent-events","sse"],"created_at":"2024-10-31T10:09:45.353Z","updated_at":"2026-05-03T23:32:19.769Z","avatar_url":"https://github.com/niels-nijens.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cloudflared SSE test\nThis repository is created to test the behavior of a PHP-based Server-Sent Events stream\nwith the [Cloudflare Argo tunnel](https://developers.cloudflare.com/argo-tunnel/quickstart/).\n\n## The problem\nAt the time of writing the cloudflared Argo tunnel does not seem to disconnect a SSE stream connection when the\nbrowser disconnects and the proxy keeps the connection alive. This causes a PHP-FPM child process to be locked to a\ndisconnected stream as the PHP script never receives a disconnection through\n[`connection_aborted()`](https://www.php.net/manual/en/function.connection-aborted).\n\nWhen enough Server-Sent event stream requests are made to the PHP-FPM container, it will eventually only be processing\n(disconnected) streams, causing a denial of service.\n\nServer-Sent event stream requests sent directly to the Nginx container will stop processing properly when they are\ndisconnected. Freeing up the PHP-FPM process.\n\n## Installation\n\n### Prerequisites\nTo install this project you require the following tooling:\n* [Git](https://git-scm.com/downloads)\n* [Docker CE](https://docs.docker.com/install/)\n* [Docker Compose](https://docs.docker.com/compose/install/)\n\nAlso, port 8090 is currently required to access the project through: [http://localhost:8090](http://localhost:8090)\n\n### Get the source\nClone this repository to be able to use/test this project:\n```bash\ngit clone https://github.com/niels-nijens/cloudflared-sse-test.git\n```\n\n## Usage\nStart the project by executing the following command:\n```bash\ndocker-compose up\n```\n\nThis command will build and start an Nginx, PHP-FPM and Cloudflared container and show the container logs.\nThe cloudflared container will create a free Argo tunnel and display output similar to the following:\n```bash\ncloudflared_1_977caf5e35f8 | time=\"2020-01-22T13:12:27Z\" level=info msg=\"Each HA connection's tunnel IDs: map[0:0765dtv5hkb3dle6bgtlb9hi0zl3vcv7367ydb4uga7f9i692kzg]\" connectionID=0\ncloudflared_1_977caf5e35f8 | time=\"2020-01-22T13:12:27Z\" level=info msg=+-------------------------------------------------------------+ connectionID=0\ncloudflared_1_977caf5e35f8 | time=\"2020-01-22T13:12:27Z\" level=info msg=\"|  Your free tunnel has started! Visit it:                    |\" connectionID=0\ncloudflared_1_977caf5e35f8 | time=\"2020-01-22T13:12:27Z\" level=info msg=\"|    https://elite-bread-accessible-rabbit.trycloudflare.com  |\" connectionID=0\ncloudflared_1_977caf5e35f8 | time=\"2020-01-22T13:12:27Z\" level=info msg=+-------------------------------------------------------------+ connectionID=0\ncloudflared_1_977caf5e35f8 | time=\"2020-01-22T13:12:27Z\" level=info msg=\"Route propagating, it may take up to 1 minute for your new route to become functional\" connectionID=0\n```\n\nThis project will be accessible through the `Visit it:` Cloudflare URL.\n\n### PHP-FPM status\nTo see the status of the (locked) PHP-FPM processes go to: [http://localhost:8090/status?html\u0026full](http://localhost:8090/status?html\u0026full)\n\n## Resources\n\n* [Server-Sent Events on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events)\n* [Cloudflare Argo tunnel documentation](https://developers.cloudflare.com/argo-tunnel/quickstart/)\n* [Cloudflared repository on GitHub](https://github.com/cloudflare/cloudflared)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniels-nijens%2Fcloudflared-sse-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniels-nijens%2Fcloudflared-sse-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniels-nijens%2Fcloudflared-sse-test/lists"}