{"id":18268597,"url":"https://github.com/viral32111/bridge","last_synced_at":"2026-04-11T22:02:20.667Z","repository":{"id":133672088,"uuid":"180982009","full_name":"viral32111/bridge","owner":"viral32111","description":"The internal communication library for my community game servers.","archived":false,"fork":false,"pushed_at":"2022-01-01T10:55:42.000Z","size":120,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-14T21:27:06.471Z","etag":null,"topics":["cpp","java","library","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/viral32111.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","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},"funding":{"custom":["https://viral32111.com/donate","http://viraldwfella5we7pdbi75pmzg4bcrehcwjstyy6tgjbqhdh6pgdi6yd.onion/donate"]}},"created_at":"2019-04-12T10:01:54.000Z","updated_at":"2022-06-01T10:01:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"8cd076c8-379e-4fb9-a73f-e3efb96adc2e","html_url":"https://github.com/viral32111/bridge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viral32111%2Fbridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viral32111%2Fbridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viral32111%2Fbridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viral32111%2Fbridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viral32111","download_url":"https://codeload.github.com/viral32111/bridge/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247968239,"owners_count":21025797,"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":["cpp","java","library","python"],"created_at":"2024-11-05T11:32:18.617Z","updated_at":"2026-04-11T22:02:15.645Z","avatar_url":"https://github.com/viral32111.png","language":"Python","funding_links":["https://viral32111.com/donate","http://viraldwfella5we7pdbi75pmzg4bcrehcwjstyy6tgjbqhdh6pgdi6yd.onion/donate"],"categories":[],"sub_categories":[],"readme":"# Bridge\n\nThis is my internal and backend communication library for my community game servers, and possibly other services in the future.\n\n**This is not designed to be used by anyone other than myself on my own servers, you cannot just download it and expect it to work for you.**\n\n**THIS IS STILL IN DEVELOPMENT AND DOES __NOT__ WORK YET!**\n\n## Details\n\nThe communication operates over a [peer-to-peer](https://en.wikipedia.org/wiki/Peer-to-peer) based connection to [unix domain sockets](https://en.wikipedia.org/wiki/Unix_domain_socket) using [datagram](https://en.wikipedia.org/wiki/Datagram) packets, making it strictly local to the host device.\n\nEach bridge client will create a receiving socket. Whenever it wants to communicate to another client, it will create a temporary sending socket, send messages to that client's receiving socket, and then it will get a response back through the temporary sending socket, which is then deleted after the communication.\n\n## Use Cases\n\nFetching live status information (e.g. hostname, map, players, tickrate) for each game server from Discord, updating a Discord category name or channel topic from each game server, etc.\n\n## History\n\nThis library is designed to be much more modular in comparison to my previous very limited \u0026 broken API I was using, it relies more on each client implementing features at their end, instead having a central server that controls and checks all features.\n\nThe previous API was HTTP based and required each client to create their own TCP HTTP server, listen for connections, respond to each one syncronously and then close the connection. It worked, but was not ideal firstly it required the game server to do much more processing, and secondly because it meant additional ports had to be opened which of course brings security risks along with it. However, I did not have the option to create something new like this because all services were hosted on seperate machines, but now that I own my own dedicated server, I can have everything run on it and communicate locally.\n\nI did attempt to create a second version of the old API that used a central web server running a PHP script to process and deliver requests, but that was a polling based system and would put much more additional strain on the web server.\n\n## Usage\n\n### [Python](python/)\n\nThis is a [Python module](https://docs.python.org/3/tutorial/modules.html), below is a concept of how it should be used.\n\n```python\n# Import the bridge library\nimport bridge\n\n# Define the message receive callback\nasync def receive( message, source ):\n\tprint( \"Received \" + message + \" from \" + source )\n\treturn \"example\"\n\n# Name this bridge client and associate the callback\nbridge.setup( \"python\", receive )\n\n# Send a message to another service and store their response\n# This can be called at any time after bridge.setup()\nresponse = await bridge.send( \"cpp\", \"hello\" )\n```\n\n### [C++](cpp/)\n\nThis is a [Garry's Mod binary module](https://wiki.facepunch.com/gmod/Creating_Binary_Modules), below is a concept of how it should be used.\n\n```lua\n-- Import the bridge library\nrequire( \"bridge\" )\n\n-- Define the message receive callback\nlocal function receive( message, source )\n\tprint( \"Received \" .. message .. \" from \" .. source )\n\treturn \"example\"\nend\n\n-- Name this bridge client and associate the callback\nbridge.setup( \"garrysmod\", receive )\n\n-- Send a message to another service and store their response\n-- This can be called at any time after bridge.setup()\nbridge.send( \"discord\", \"hello\" )\n```\n\n### [Java](java/)\n\nThis is a [Minecraft bukkit plugin](https://dev.bukkit.org/).\n\n*I am still learning Java and Minecraft plugin programming, so I have no idea how I would go about doing this yet!*\n\n## License\n\nCopyright (C) 2019 - 2022 [viral32111](https://viral32111.com).\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU Affero General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU Affero General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License\nalong with this program. If not, see https://www.gnu.org/licenses.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviral32111%2Fbridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviral32111%2Fbridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviral32111%2Fbridge/lists"}