{"id":20286268,"url":"https://github.com/costaq/socketjs-client","last_synced_at":"2026-04-29T23:33:24.454Z","repository":{"id":62075163,"uuid":"557146693","full_name":"costaq/socketjs-client","owner":"costaq","description":"websocket / typescript","archived":false,"fork":false,"pushed_at":"2022-10-28T07:45:03.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-04T16:54:14.551Z","etag":null,"topics":["typescript","websocket"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/costaq.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}},"created_at":"2022-10-25T06:50:27.000Z","updated_at":"2023-01-17T08:26:21.000Z","dependencies_parsed_at":"2023-01-20T14:45:24.453Z","dependency_job_id":null,"html_url":"https://github.com/costaq/socketjs-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/costaq/socketjs-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/costaq%2Fsocketjs-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/costaq%2Fsocketjs-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/costaq%2Fsocketjs-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/costaq%2Fsocketjs-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/costaq","download_url":"https://codeload.github.com/costaq/socketjs-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/costaq%2Fsocketjs-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32448400,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"ssl_error","status_checked_at":"2026-04-29T22:10:49.234Z","response_time":110,"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":["typescript","websocket"],"created_at":"2024-11-14T14:32:18.155Z","updated_at":"2026-04-29T23:33:24.438Z","avatar_url":"https://github.com/costaq.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# socketjs-client\nwebsocket / typescript\n\n## Installation\n\n`npm i -D socketjs-client`\n\n## Basic Usage\n\n```ts\n\n// 基础使用\nimport Socket from 'socketjs-client';\n\nconst options = {\n    url: 'ws://localhost:8099/ws', // 必填，链接的通道的地址\n    heartTime: 5000, // 必填，心跳时间间隔（毫秒）\n    reconnectTime: 5000, // 非必填，默认5000，重连时间间隔（毫秒）\n    reconnectCount: 5 // 非必填，默认5，重连次数，-1则不限制\n};\nnew Socket(options);\n\n// 销毁\nconst socket = new Socket(options);\nsocket.destroy();\n\n// 自定义回调(可额外处理业务上其他逻辑)\nconst options = {\n    url: 'ws://localhost:8099/ws',\n    heartTime: 5000,\n    openCallback: () =\u003e {}, // 连接成功的回调\n    closeCallback: () =\u003e {}, // 连接关闭的回调\n    messageCallback: () =\u003e {}, // 收到消息的回调\n    errorCallback: () =\u003e {}, // 发生错误的回调\n};\nnew Socket(options);\n\n```\n\n[传送门：Koa封装](https://github.com/costaq/socketjs-koa)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcostaq%2Fsocketjs-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcostaq%2Fsocketjs-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcostaq%2Fsocketjs-client/lists"}