{"id":27132959,"url":"https://github.com/erio-harrison/smartlink-server","last_synced_at":"2025-04-07T22:35:58.237Z","repository":{"id":285657460,"uuid":"958410931","full_name":"Erio-Harrison/smartlink-server","owner":"Erio-Harrison","description":"server for smartlink","archived":false,"fork":false,"pushed_at":"2025-04-02T00:22:40.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T01:26:41.413Z","etag":null,"topics":["rust","server","smartlink"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/Erio-Harrison.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":"2025-04-01T06:45:05.000Z","updated_at":"2025-04-02T00:22:43.000Z","dependencies_parsed_at":"2025-04-02T01:26:48.187Z","dependency_job_id":"4068cd95-e70e-4539-84c5-754bfeca29d0","html_url":"https://github.com/Erio-Harrison/smartlink-server","commit_stats":null,"previous_names":["erio-harrison/smartlink-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erio-Harrison%2Fsmartlink-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erio-Harrison%2Fsmartlink-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erio-Harrison%2Fsmartlink-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erio-Harrison%2Fsmartlink-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Erio-Harrison","download_url":"https://codeload.github.com/Erio-Harrison/smartlink-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247743575,"owners_count":20988771,"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":["rust","server","smartlink"],"created_at":"2025-04-07T22:35:57.743Z","updated_at":"2025-04-07T22:35:58.231Z","avatar_url":"https://github.com/Erio-Harrison.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SmartLink WebSocket Server\n\n这是 SmartLink 应用的 WebSocket 服务器，用于管理在线用户和转发实时消息。\n\n## 功能\n\n- 用户连接管理\n- 实时消息转发\n- 支持私聊和群聊消息\n- 支持消息状态更新\n- 支持 WebRTC 信令\n- 支持输入状态指示\n\n## 运行方式\n\n### 本地开发\n\n```bash\n# 克隆仓库\ngit clone [repository-url]\ncd smartlink-websocket-server\n\n# 运行服务器\ncargo run\n```\n\n服务器默认在 `0.0.0.0:8080` 监听 WebSocket 连接。\n\n## 消息格式\n\n服务器处理以下格式的 JSON 消息：\n\n```json\n{\n  \"message_type\": \"NewMessage\",\n  \"sender_id\": \"user123\",\n  \"conversation_id\": \"conv456\",\n  \"recipient_id\": \"user789\",\n  \"message_id\": \"msg123\",\n  \"data\": {\n    \"content\": \"Hello!\",\n    \"content_type\": \"text\",\n    \"recipients\": [\"user789\"]\n  },\n  \"timestamp\": \"2023-05-01T12:34:56.789Z\"\n}\n```\n\n## 连接方式\n\n客户端连接后，必须首先发送一个 `UserStatus` 类型的消息来验证身份：\n\n```json\n{\n  \"message_type\": \"UserStatus\",\n  \"sender_id\": \"user123\",\n  \"data\": {\n    \"status\": \"online\"\n  },\n  \"timestamp\": \"2023-05-01T12:34:56.789Z\"\n}\n```\n\n## 消息类型\n\n服务器支持以下消息类型：\n\n- `UserStatus`: 用户状态更新\n- `NewMessage`: 新消息\n- `MessageStatusUpdate`: 消息状态更新（已读、已送达等）\n- `WebRTCSignal`: 用于 WebRTC 通话的信令\n- `TypingIndicator`: 输入状态指示\n\n## 配置选项\n\n目前服务器使用硬编码的配置。未来版本将支持通过环境变量或配置文件进行配置。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferio-harrison%2Fsmartlink-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferio-harrison%2Fsmartlink-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferio-harrison%2Fsmartlink-server/lists"}