{"id":22859960,"url":"https://github.com/reelyactive/raddec-relay","last_synced_at":"2025-03-31T08:22:47.634Z","repository":{"id":69137001,"uuid":"194845296","full_name":"reelyactive/raddec-relay","owner":"reelyactive","description":"Relay raddecs to and from remote servers.  We believe in an open Internet of Things.","archived":false,"fork":false,"pushed_at":"2019-09-22T13:29:31.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T12:53:43.724Z","etag":null,"topics":["raddec"],"latest_commit_sha":null,"homepage":null,"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/reelyactive.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":"2019-07-02T10:52:35.000Z","updated_at":"2019-09-22T13:29:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"5d2b341e-9ee1-4482-a50a-adee4fc99239","html_url":"https://github.com/reelyactive/raddec-relay","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/reelyactive%2Fraddec-relay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fraddec-relay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fraddec-relay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fraddec-relay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reelyactive","download_url":"https://codeload.github.com/reelyactive/raddec-relay/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246436906,"owners_count":20777117,"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":["raddec"],"created_at":"2024-12-13T09:08:31.992Z","updated_at":"2025-03-31T08:22:47.627Z","avatar_url":"https://github.com/reelyactive.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"raddec-relay\n============\n\n\nRelay raddecs to and from remote servers\n----------------------------------------\n\nInterface for specific raddec-relay instances which relay [raddec](https://github.com/reelyactive/raddec)s to and from remote servers, with optional load balancing (see [raddec-balancer](https://github.com/reelyactive/raddec-balancer)).  Currently supports the following raddec-relay-x instances:\n\n- [raddec-relay-udp](https://github.com/reelyactive/raddec-relay-udp)\n\n\nInstallation\n------------\n\n    npm install raddec-relay\n\n\nHello raddec-relay!\n-------------------\n\nThe following code will configure the relaying of raddecs over UDP from the local instance to port 55555 on the localhost.\n\n```javascript\nconst RaddecRelay = require('raddec-relay');\nconst RaddecRelayUdp = require('raddec-relay-udp');\n\nconst sources = [ { address: \"0.0.0.0\" } ];\nconst targets = [ { address: \"127.0.0.1\", port: 55555 } ];\n\nlet relay = new RaddecRelay();\n\nrelay.addChannel(RaddecRelayUdp, { sources: sources, targets: targets });\n```\n\n\nConfiguration Examples\n----------------------\n\n__raddec-relay__ supports a variety of configurations for receiving and/or relaying raddecs, as described in the following examples.\n\n### Example: relay raddecs to remote server(s)\n\n```javascript\nconst RaddecRelay = require('raddec-relay');\nconst RaddecRelayUdp = require('raddec-relay-udp');\n\nconst targets = [\n    { address: \"12.34.56.78\", port: 50001 },\n    { address: \"98.76.54.32\", port: 50001 }\n];\n\nlet relay = new RaddecRelay();\nrelay.addChannel(RaddecRelayUdp, { targets: targets });\n\nlet raddec = ...;  // Typically locally decoded radio packets in this case\n\nrelay.relayRaddec(raddec);  // Relay the raddec to the remote servers\n```\n\n### Example: listen for and handle inbound raddecs\n\n```javascript\nconst RaddecRelay = require('raddec-relay');\nconst RaddecRelayUdp = require('raddec-relay-udp');\n\nconst sources = [ { address: \"0.0.0.0\", port: 50001 } ];\n\nlet relay = new RaddecRelay({ raddecHandler: handleRaddec });\nrelay.addChannel(RaddecRelayUdp, { sources: sources });\n\nfunction handleRaddec(raddec) {\n  // Do something with the received raddec\n}\n```\n\n### Example: relay raddecs from source(s) to target(s)\n\n```javascript\nconst RaddecRelay = require('raddec-relay');\nconst RaddecRelayUdp = require('raddec-relay-udp')\n\nconst sources = [ { address: \"0.0.0.0\", port: 50001 } ];\nconst targets = [ { address: \"12.34.56.78\", port: 50001 } ];\n\nlet relay = new RaddecRelay();\nrelay.addChannel(RaddecRelayUdp, { sources: sources,\n                                   targets: targets });\n``` \n\n### Example: balance raddecs from source(s) across targets\n\n```javascript\nconst RaddecRelay = require('raddec-relay');\nconst RaddecBalancer = require('raddec-balancer');\nconst RaddecRelayUdp = require('raddec-relay-udp')\n\nconst sources = [ { address: \"0.0.0.0\", port: 50001 } ];\nconst targets = [ { address: \"127.0.0.1\", port: 55550 },\n                  { address: \"127.0.0.1\", port: 55551 },\n                  { address: \"127.0.0.1\", port: 55552 },\n                  { address: \"127.0.0.1\", port: 55553 } ];\n\nlet balancer = new RaddecBalancer({ numberOfTargets: targets.length });\nlet relay = new RaddecRelay({ balancer: balancer });\nrelay.addChannel(RaddecRelayUdp, { sources: sources,\n                                   targets: targets });\n```\n\n\nOptions\n-------\n\n__raddec-relay__ supports the following options:\n\n| Property              | Default | Description                            | \n|:----------------------|:--------|:---------------------------------------|\n| enableForwarding      | true    | Forward raddecs from sources to targets (if both are present) through the balancer (if present) |\n| balancer              | null    | A raddec-balancer instance             |\n| raddecHandler         | null    | Function to call when source raddec received |\n\n\nLicense\n-------\n\nMIT License\n\nCopyright (c) 2019 [reelyActive](https://www.reelyactive.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN \nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freelyactive%2Fraddec-relay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freelyactive%2Fraddec-relay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freelyactive%2Fraddec-relay/lists"}