{"id":16676219,"url":"https://github.com/cseufert/php-socket","last_synced_at":"2026-01-30T12:33:49.433Z","repository":{"id":11704170,"uuid":"14219837","full_name":"cseufert/php-socket","owner":"cseufert","description":"A PHP Comet Library with Fallbacks","archived":false,"fork":false,"pushed_at":"2013-11-08T00:19:29.000Z","size":86,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-11T05:07:08.087Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cseufert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-08T00:13:33.000Z","updated_at":"2019-07-24T00:50:49.000Z","dependencies_parsed_at":"2022-08-28T02:12:07.071Z","dependency_job_id":null,"html_url":"https://github.com/cseufert/php-socket","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cseufert/php-socket","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cseufert%2Fphp-socket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cseufert%2Fphp-socket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cseufert%2Fphp-socket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cseufert%2Fphp-socket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cseufert","download_url":"https://codeload.github.com/cseufert/php-socket/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cseufert%2Fphp-socket/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28912911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T12:13:43.263Z","status":"ssl_error","status_checked_at":"2026-01-30T12:13:22.389Z","response_time":66,"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":[],"created_at":"2024-10-12T13:09:38.639Z","updated_at":"2026-01-30T12:33:49.418Z","avatar_url":"https://github.com/cseufert.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"php-socket\n==========\n\nA PHP Comet Library\n\nAn example of how to use (server):\n\ndaemon.php\n```php\n\u003c?php\n$comet = new comet();\n$comet-\u003eon('connection', function($client) {\n  $client-\u003eraise('ping');\n  $client-\u003eon('pong', function($data) {\n    if($data['clientid'] == $client-\u003eid) {\n      // Connection OK!\n  });\n});\n```\n\nYou can also send messages to clients outside an active comet session:\n\n```php\n\u003c?php\n$message = \"You have mail\";\n$comet = new comet();\n$client = $comet-\u003egetClient(123); // Client ID is 123 here\n$client-\u003eraise('message', ['message'=\u003e$message]);\n```\n\ncomet.php\n```php\n\u003c?php\n$session = new cometSession();\n$session-\u003eprocess();\n```\n\nAnd an example of the JavaScript code:\n\n```javascript\ncomet.on('ping', function(data) {\n  comet.raise('pong', {'clientid': comet.client.id});\n});\ncomet.on('message', function(data) {\n  console.log(\"Message received: \" + data['message']);\n});\ncomet.start({'server': '/comet.php', 'clientid': 123});\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcseufert%2Fphp-socket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcseufert%2Fphp-socket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcseufert%2Fphp-socket/lists"}