{"id":22688434,"url":"https://github.com/javanile/centralio","last_synced_at":"2025-06-14T15:33:04.570Z","repository":{"id":89152290,"uuid":"113624696","full_name":"javanile/centralio","owner":"javanile","description":"Client/Server library for UDP","archived":false,"fork":false,"pushed_at":"2022-02-05T22:03:28.000Z","size":23,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-12T21:52:22.698Z","etag":null,"topics":["client-server","node-module","nodejs","state-machine","udp","udp-client","udp-server"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/javanile.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":"2017-12-08T22:57:46.000Z","updated_at":"2024-07-18T11:21:23.000Z","dependencies_parsed_at":"2023-05-03T14:31:50.797Z","dependency_job_id":null,"html_url":"https://github.com/javanile/centralio","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/javanile/centralio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javanile%2Fcentralio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javanile%2Fcentralio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javanile%2Fcentralio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javanile%2Fcentralio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/javanile","download_url":"https://codeload.github.com/javanile/centralio/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javanile%2Fcentralio/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259838018,"owners_count":22919508,"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":["client-server","node-module","nodejs","state-machine","udp","udp-client","udp-server"],"created_at":"2024-12-10T00:14:28.060Z","updated_at":"2025-06-14T15:33:04.522Z","avatar_url":"https://github.com/javanile.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Centralio\nCentralio is a library for creating applications with many clients and a central server based on the UDP protocol.\n\n[![Build Status](https://travis-ci.org/javanile-bot/centralio.svg?branch=master)](https://travis-ci.org/javanile-bot/centralio)\n[![Maintainability](https://api.codeclimate.com/v1/badges/1501d777dd5519cf7d2e/maintainability)](https://codeclimate.com/github/javanile-bot/centralio/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/1501d777dd5519cf7d2e/test_coverage)](https://codeclimate.com/github/javanile-bot/centralio/test_coverage)\n\n## Get Starded\nIf you want use Centralio simply add dependency into your project\n```bash\n$ npm install centralio\n```\n\n### Your first server\n```javascript\n// file: server.js\n// exec: node server\nconst server = require('centralio').server();\n\n// Start your server \nserver.start('127.0.0.1', '44044');\n\n// Handle received messages from client\nserver.rx(function(client, msg) {\n  console.log('Message from client:', client.id, msg);  \n  // Respond to client\n  client.tx('Thanks from your message.');\n});\n```\n\n### Your first client\n```javascript\n// file: client.js\n// exec: node client\nconst client = require('centralio').client();\n\n// Start your client\nclient.start('127.0.0.1', '44044');\n\n// Handle received message from server\nclient.rx(function(msg) {\n  console.log('Message from server:', msg);    \n});\n\n// Send message to server\nclient.tx('Hi my server!');\n```\n\n## Manage client state\n![Centralio Client/Server sample architecture](http://www.plantuml.com/plantuml/png/ROyn2uCm48Nt_8h3tS74GWsbIrsw5Ketbv3SbO2S46FpzqjZ5H7Nzpw-TyU3GoYU63uOuDK-Ehxr7Zb2fS4Ep6ZZ6aaD0r7l6TT8QKZ6Hy_l0im8O_O8mTcwc3g-jnhgvZmHraq6RQwg7IbdKfARY19jIBaZrTyP4fdHdJQa4cA-0YvbULs6GF-UgmygUP0fyGK0)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavanile%2Fcentralio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjavanile%2Fcentralio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavanile%2Fcentralio/lists"}