{"id":18479395,"url":"https://github.com/yggverse/nex-php","last_synced_at":"2026-05-20T07:38:31.643Z","repository":{"id":234907088,"uuid":"789719357","full_name":"YGGverse/nex-php","owner":"YGGverse","description":"PHP Library for NEX Protocol","archived":false,"fork":false,"pushed_at":"2024-07-08T02:03:08.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-13T18:51:10.647Z","etag":null,"topics":["1900","altweb","client","composer","library","nex","nex-client","nex-library","nex-php","nex-protocol","nex-protocol-client","nex-protocol-php","nex-protocol-server","nex-server","php","server","smallweb","tinyweb"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/YGGverse.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":"2024-04-21T11:19:02.000Z","updated_at":"2024-07-08T02:03:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"a38c95a2-e0bf-4cf1-a6a6-2691ea2c313b","html_url":"https://github.com/YGGverse/nex-php","commit_stats":null,"previous_names":["yggverse/nex-php"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/YGGverse/nex-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YGGverse%2Fnex-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YGGverse%2Fnex-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YGGverse%2Fnex-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YGGverse%2Fnex-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YGGverse","download_url":"https://codeload.github.com/YGGverse/nex-php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YGGverse%2Fnex-php/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265059963,"owners_count":23705225,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["1900","altweb","client","composer","library","nex","nex-client","nex-library","nex-php","nex-protocol","nex-protocol-client","nex-protocol-php","nex-protocol-server","nex-server","php","server","smallweb","tinyweb"],"created_at":"2024-11-06T12:14:33.952Z","updated_at":"2026-05-20T07:38:26.621Z","avatar_url":"https://github.com/YGGverse.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nex-php\n\nPHP 8 Library for NEX Protocol (see also [nps-php](https://github.com/YGGverse/nps-php))\n\n## Usage\n\n```\ncomposer require yggverse/nex\n```\n\n## Client\n\nPHP interface for NEX protocol queries\n\n``` php\n$client = new \\Yggverse\\Nex\\Client;\n```\n\n#### Client::request\n\nRequest data from URL | URI if constructed by URL\n\n``` php\nvar_dump(\n    $client-\u003erequest(\n        'nex://nightfall.city/nex/'\n    )\n);\n```\n\n#### Client::setHost\n#### Client::getHost\n#### Client::setPort\n#### Client::getPort\n#### Client::setPath\n#### Client::getPath\n#### Client::setQuery\n#### Client::getQuery\n#### Client::getOptions\n#### Client::setOptions\n\n## Server\n\nBuild interactive server instance to listen NEX protocol connections!\n\n``` php\n$server = new \\Yggverse\\Nex\\Server;\n```\n\nProvide optional `host`, `port` and `size` arguments in constructor or use available setters after object initiation.\n\n``` php\n$server = new \\Yggverse\\Nex\\Server('127.0.0.1', 1900);\n```\n\n#### Server::setHost\n#### Server::getHost\n#### Server::setPort\n#### Server::getPort\n#### Server::setSize\n#### Server::getSize\n#### Server::setLive\n#### Server::getLive\n\n#### Server::start\n\nRun server object using this method.\n\nDefine handler function as the argument to process application logic dependent of client request.\n\n``` php\n$server-\u003estart(\n    function (\n        string $request,\n        string $connect\n    ): ?string\n    {\n        printf(\n            'connection: %s request: %s',\n            $connect,\n            $request\n        );\n\n        return null; // null|string response\n    }\n);\n```\n\n#### Server::stop\n\nStop server instance.\n\nSame to `Server::setLive(false)`\n\n## Integrations\n\n* [next](https://github.com/YGGverse/next) - PHP 8 Server for NEX Protocol","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyggverse%2Fnex-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyggverse%2Fnex-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyggverse%2Fnex-php/lists"}