{"id":22528756,"url":"https://github.com/zing-dev/relay-server-www","last_synced_at":"2026-02-12T19:32:16.689Z","repository":{"id":96129210,"uuid":"309990238","full_name":"zing-dev/relay-server-www","owner":"zing-dev","description":null,"archived":false,"fork":false,"pushed_at":"2021-07-05T09:26:53.000Z","size":1238,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master-new","last_synced_at":"2025-08-18T20:51:16.545Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zing-dev.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":"2020-11-04T12:02:49.000Z","updated_at":"2021-07-05T09:26:56.000Z","dependencies_parsed_at":"2023-06-15T17:15:51.763Z","dependency_job_id":null,"html_url":"https://github.com/zing-dev/relay-server-www","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zing-dev/relay-server-www","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zing-dev%2Frelay-server-www","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zing-dev%2Frelay-server-www/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zing-dev%2Frelay-server-www/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zing-dev%2Frelay-server-www/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zing-dev","download_url":"https://codeload.github.com/zing-dev/relay-server-www/tar.gz/refs/heads/master-new","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zing-dev%2Frelay-server-www/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29378819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T19:05:20.189Z","status":"ssl_error","status_checked_at":"2026-02-12T19:01:44.216Z","response_time":55,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-12-07T07:12:15.810Z","updated_at":"2026-02-12T19:32:16.668Z","avatar_url":"https://github.com/zing-dev.png","language":"Vue","readme":"## 继电器服务端页面 relay-server-www\n\n### 获取配置\n`GET` `http://localhost:9009/api/config`\n```json\n{\n    \"status\": true,\n    \"message\": \"获取配置信息\",\n    \"data\": {\n        \"port\": 9009,\n        \"address\": \"COM7\",\n        \"slave_id\": 1,\n        \"branch_length\": 8,\n        \"white_list\": [\n            \"*\",\n            \"::1\",\n            \"127.0.0.1\",\n            \"192.168.0.7\"\n        ]\n    }\n}\n```\n\n#### 更新配置\n`POST` `http://localhost:9009/api/config`\n\n#### header\n`content-type:application/json`\n\n#### 参数\n```json\n{\n\t\"port\": 9009,\n\t\"address\": \"COM7\",\n\t\"slave_id\": 1,\n\t\"branch_length\": 8,\n\t\"white_list\": [\n\t\t\"*\",\n\t\t\"::1\",\n\t\t\"127.0.0.1\",\n\t\t\"192.168.0.7\"\n\t]\n}\n```\n\n#### 闭合所有\n`GET` `http://localhost:9009/api/on-all`\n\n#### 断开所有\n`GET` `http://localhost:9009/api/off-all`\n\n#### 闭合继电器某些路\n`GET` `http://localhost:9009/api/on/{branches}`\n\n##### 示例\n`http://localhost:9009/api/on/0,1,2,3,4,5,6`\n\u003e 闭合0,1,2,3,4,5,6路\n\n#### 断开继电器某些路\n`GET` `http://localhost:9009/api/off/{branches}`\n\n##### 示例\n`http://localhost:9009/api/off/0,1,2,3,4,5,6`\n\u003e 断开0,1,2,3,4,5,6路\n\n#### 翻转继电器某些路\n`GET` `http://localhost:9009/api/flip/{branches}`\n \n##### 示例\n`GET` `http://localhost:9009/api/flip/0,1,2,3,4,5,6`\n\u003e - 如果0,1,2,3,4,5,6路闭合,则翻转断开\n\u003e - 如果0,1,2,3,4,5,6路断开,则翻转闭合\n\n#### 闭合某路一段时间后自动断开\n`GET` `http://localhost:9009/api/on-point/{branch}/{time}`\n\n##### 示例\n`http://localhost:9009/api/on-point/0/2000`\n\u003e 闭合第0路继电器2000毫秒后断开\n\n#### 断开某路一段时间后自动闭合\n`GET`  `http://localhost:9009/api/off-point/{branch}/{time}`\n\n##### 示例\n`http://localhost:9009/api/off-point/0/2000`\n\u003e 断开第0路继电器2000毫秒后闭合\n\n#### ping\n`GET` `http://localhost:9009/api/ping`\n\n##### 返回值\n```json\n{\n\t\"status\": true,\n\t\"message\": \"ping\",\n\t\"data\": {\n\t\t\"connected\": true,\n\t\t\"connected_time\": 1350,\n\t\t\"running_time\": 1350,\n\t\t\"status\": [\n\t\t\t1,\n\t\t\t1,\n\t\t\t1,\n\t\t\t1,\n\t\t\t1,\n\t\t\t1,\n\t\t\t1,\n\t\t\t0\n\t\t],\n\t\t\"message\": \"success\"\n\t}\n}\n```\n#### 版本\n`GET` `http://localhost:9009/api/version`\n```json\n{\n\t\"status\": true,\n\t\"message\": \"获取版本\",\n\t\"data\": [{\n\t\t\t\"tag\": \"0.0.8\",\n\t\t\t\"log\": \"update module address\",\n\t\t\t\"status\": \"Base\",\n\t\t\t\"hash\": \"a96c3cf8276b39ef503fbafc96bbad6b\",\n\t\t\t\"git_hash\": \"\",\n\t\t\t\"created_at\": \"2020.09.24 15:54:44\"\n\t\t},\n\t\t{\n\t\t\t\"tag\": \"0.0.7\",\n\t\t\t\"log\": \"add LICENSE\",\n\t\t\t\"status\": \"Base\",\n\t\t\t\"hash\": \"499050ce9289cd6ab663e3ae3630700a\",\n\t\t\t\"git_hash\": \"c7b9505af0431c01d6cdb9f6b25c8b70a57ab8d5\",\n\t\t\t\"created_at\": \"2020.09.24 10:00:11\"\n\t\t},\n\t\t{\n\t\t\t\"tag\": \"0.0.6\",\n\t\t\t\"log\": \"update...\",\n\t\t\t\"status\": \"Base\",\n\t\t\t\"hash\": \"cc122a930a75ac3e9bb290fa4654b62e\",\n\t\t\t\"git_hash\": \"b3783d195bdc7f2c609ab35edc23b6ba7c319ba0\",\n\t\t\t\"created_at\": \"2020.08.28 17:04:53\"\n\t\t},\n\t\t{\n\t\t\t\"tag\": \"0.0.1\",\n\t\t\t\"log\": \"init\",\n\t\t\t\"status\": \"Base\",\n\t\t\t\"hash\": \"46c9ab35431609ae4950d5ec6d1d7d2a\",\n\t\t\t\"git_hash\": \"6effa2b0971e2449c9fb223b2c966d48cb5ea09f\",\n\t\t\t\"created_at\": \"2019.12.03 16:54:52\"\n\t\t}\n\t]\n}\n```\n### WebSocket接口 \n`ws://localhost:9009/ws`\n\n#### 返回值通用结构\n```json\n{\n  \"type\": \"log\",\n  \"\": \"\"\n}\n```\n### `type == log`\n```json\n{\n\t\"level\": \"info\",\n\t\"msg\": \"新的websocket连接: ::1-128\",\n\t\"time\": \"2020-09-27 14:35:28\",\n\t\"type\": \"log\"\n}\n```\n### `type == status`\n```json\n{\n\t\"type\": \"status\",\n\t\"data\": {\n\t\t\"connected\": true,\n\t\t\"connected_time\": 1220,\n\t\t\"running_time\": 1220,\n\t\t\"status\": [1, 1, 1, 1, 1, 1, 1, 0],\n\t\t\"message\": \"success\"\n\t}\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzing-dev%2Frelay-server-www","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzing-dev%2Frelay-server-www","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzing-dev%2Frelay-server-www/lists"}