{"id":18366954,"url":"https://github.com/injoyai/ios","last_synced_at":"2026-04-09T10:07:35.127Z","repository":{"id":252372510,"uuid":"839609659","full_name":"injoyai/ios","owner":"injoyai","description":"万物皆IO,任意数据的互通,例如http数据桥接到串口上,实现通过串口上网","archived":false,"fork":false,"pushed_at":"2026-02-26T09:01:48.000Z","size":350,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-26T13:55:37.165Z","etag":null,"topics":["io","mqtt","serial","sse","ssh","tcp","websocket"],"latest_commit_sha":null,"homepage":"","language":"Go","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/injoyai.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-08-08T01:07:13.000Z","updated_at":"2026-02-12T06:38:03.000Z","dependencies_parsed_at":"2024-08-26T08:11:26.892Z","dependency_job_id":"0cd81ba6-8f5f-4070-aef8-93f756e4fa14","html_url":"https://github.com/injoyai/ios","commit_stats":null,"previous_names":["injoyai/ios"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/injoyai/ios","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/injoyai%2Fios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/injoyai%2Fios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/injoyai%2Fios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/injoyai%2Fios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/injoyai","download_url":"https://codeload.github.com/injoyai/ios/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/injoyai%2Fios/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30111728,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T03:40:26.266Z","status":"ssl_error","status_checked_at":"2026-03-05T03:39:15.902Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["io","mqtt","serial","sse","ssh","tcp","websocket"],"created_at":"2024-11-05T23:19:28.660Z","updated_at":"2026-04-09T10:07:35.113Z","avatar_url":"https://github.com/injoyai.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# io\n\n\n### 如何使用\n\n#### 如何连接TCP\n\n```go\n\npackage main\n\nimport (\n\t\"github.com/injoyai/ios/v2\"\n\t\"github.com/injoyai/ios/v2/client\"\n\t\"github.com/injoyai/ios/v2/client/redial\"\n\t\"time\"\n)\n\nfunc main() {\n\taddr := \"127.0.0.1:10086\"\n\tredial.Run(dial.WithTCP(addr),\n\t\tfunc(c *client.Client) {\n\t\t\tc.Logger.Debug()                      //开启打印日志\n\t\t\tc.Logger.WithUTF8()                   //打印日志编码ASCII\n\t\t\tc.OnReadFrom(ios.NewRead4KB()) //设置读取方式,一次读取4KB\n\t\t\tc.OnDealMessage(func(c *client.Client, msg ios.Acker) {\n\t\t\t\t// todo 业务逻辑,处理读取到的数据\n\t\t\t})\n\t\t\tc.OnConnected(func(c *client.Client) error {\n\t\t\t\tc.GoTimerWriter(time.Minute, func(w ios.MoreWriter) error {\n\t\t\t\t\t_, err := w.WriteString(\"心跳\") //定时发送心跳\n\t\t\t\t\treturn err\n\t\t\t\t})\n                return nil\n            })\n\t\t}, \n    )\n}\n\n```\n\n#### 如何连接SSH\n\n```go\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"github.com/injoyai/ios/v2/client/redial\"\n\t\"github.com/injoyai/ios/v2/module/ssh\"\n\t\"os\"\n)\n\nfunc main() {\n\tc := redial.SSH(\u0026ssh.Config{\n\t\tAddress:  os.Args[1],\n\t\tUser:     os.Args[2],\n\t\tPassword: os.Args[3],\n\t})\n\tc.Logger.Debug(false)\n\tc.OnDealMessage(func(c *client.Client, msg ios.Acker) {\n\t\tfmt.Print(string(msg.Payload()))\n\t})\n\tgo c.Run()\n\treader := bufio.NewReader(os.Stdin)\n\tfor {\n\t\tselect {\n\t\tcase \u003c-c.Done():\n\t\t\treturn\n\t\tdefault:\n\t\t\tbs, _, _ := reader.ReadLine()\n\t\t\tc.Write(append(bs, '\\n'))\n\t\t}\n\t}\n}\n\n```\n\n#### 如何连接Websocket\n\n```go\npackage main\n\nimport(\n\t\"bufio\"\n\t\"github.com/injoyai/ios/v2\"\n\t\"github.com/injoyai/ios/v2/client/redial\"\n\t\"os\"\n)\n\nfunc main(){\n\tredial.RunWebsocket(\"http://127.0.0.1:80/ws\",nil,\n\t\tfunc(c *client.Client) {\n\t\t\tc.Logger.Debug()\n\t\t\tc.Logger.WithUTF8()\n\t\t\tc.OnDealMessage(func(c *client.Client, msg ios.Acker){\n\t\t\t\t// todo 业务逻辑,处理读取到的数据\n\t\t\t})\n        })\n\t\n}\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finjoyai%2Fios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finjoyai%2Fios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finjoyai%2Fios/lists"}