{"id":15757163,"url":"https://github.com/treethought/hydra-relay","last_synced_at":"2025-08-22T14:06:24.575Z","repository":{"id":78924423,"uuid":"478767009","full_name":"treethought/hydra-relay","owner":"treethought","description":null,"archived":false,"fork":false,"pushed_at":"2022-04-07T02:49:23.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-06T12:48:25.200Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/treethought.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-07T00:09:22.000Z","updated_at":"2022-04-07T00:15:20.000Z","dependencies_parsed_at":"2023-04-18T21:28:34.532Z","dependency_job_id":null,"html_url":"https://github.com/treethought/hydra-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/treethought%2Fhydra-relay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treethought%2Fhydra-relay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treethought%2Fhydra-relay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treethought%2Fhydra-relay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/treethought","download_url":"https://codeload.github.com/treethought/hydra-relay/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246438701,"owners_count":20777472,"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":[],"created_at":"2024-10-04T09:04:28.445Z","updated_at":"2025-03-31T08:26:42.054Z","avatar_url":"https://github.com/treethought.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hydra-relay\n\nA simple websocket server for relaying messages to hydra from non-hydra peers.\n\nThis was primarily created to send code to be evaluated within hydra from\nneovim\n\nCurrently, this is just a simple websocket server that forwards messages to all\nconnected clients. Taken almost directly from gorilla websocket library's\n[example](https://github.com/gorilla/websocket/tree/master/examples/chat).\n\n## Usage\n\nStart the relay server, passing the port to listen on (default 8088).\n\n```\nhydra-relay --port 8088\n```\n\nOpen an instance of hydra, and paste the following:\n\n```\n// replace with your relay address\nconst socket = new WebSocket('ws://localhost:8088/ws'); \n\n\n// Connection opened\nsocket.addEventListener('open', function (event) {\n  socket.send('greetings from hydra');\n});\n\n\nfunction evalRelay(block) {\n  try {\n\t  console.log(eval(block))\n  } catch (err) {\n    console.log(\"error in relay message eval\")\n    socket.send(JSON.stringify(err.message))\n  }\n}\n\nsocket.addEventListener('message', function (event) {\n  console.log(event.data);\n  evalRelay(event.data);\n});\n```\n\nThen send blocks of javascript to your relay to have them evaluated in hydra via\nany websocket client.\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftreethought%2Fhydra-relay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftreethought%2Fhydra-relay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftreethought%2Fhydra-relay/lists"}