{"id":13487209,"url":"https://github.com/cytle/socket.io-mp-client","last_synced_at":"2025-08-20T08:32:03.452Z","repository":{"id":53388569,"uuid":"117316840","full_name":"cytle/socket.io-mp-client","owner":"cytle","description":"小程序socket.io客户端, 支持微信小程序、支付宝小程序","archived":false,"fork":false,"pushed_at":"2022-10-30T21:17:24.000Z","size":711,"stargazers_count":118,"open_issues_count":5,"forks_count":45,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-12-13T19:12:19.246Z","etag":null,"topics":[],"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/cytle.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":"2018-01-13T05:26:06.000Z","updated_at":"2024-09-18T03:19:34.000Z","dependencies_parsed_at":"2022-08-26T13:02:20.213Z","dependency_job_id":null,"html_url":"https://github.com/cytle/socket.io-mp-client","commit_stats":null,"previous_names":["cytle/socket.io-wxapp-client"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cytle%2Fsocket.io-mp-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cytle%2Fsocket.io-mp-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cytle%2Fsocket.io-mp-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cytle%2Fsocket.io-mp-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cytle","download_url":"https://codeload.github.com/cytle/socket.io-mp-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230408170,"owners_count":18220974,"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-07-31T18:00:56.636Z","updated_at":"2024-12-19T09:07:00.882Z","avatar_url":"https://github.com/cytle.png","language":"JavaScript","funding_links":[],"categories":["工具"],"sub_categories":[],"readme":"# socket.io-mp-client\n\n小程序socket.io客户端, 支持微信小程序、支付宝小程序\n\n![socket.io-client v-2.0.4](https://img.shields.io/badge/socket.io--client-v2.0.4-blue.svg)\n\n## Usage\n\n使用和`web`版一致, 文档在此[socket.io](https://socket.io/docs/).\n\n**不同处**: 因为小程序没有`xhr`, 这边也就不支持`polling`(轮询), 在`engine.io-mp-client`包中就砍\n掉了这部分. 对小程序开发没啥影响, 不过也需要提下\n\n1. `transports`类型, 也不支持`polling`, 只有`websocket`\n2. `web`版建立`websocket`前会使用`http`请求握手, 小程序默认直接打开`socket`连接\n\n### 1. npm包\n\n```console\nnpm install --save socket.io-mp-client\n```\n\n```js\nconst wxappIo = require('socket.io-mp-client');\n```\n\n### 2. 直接引入文件\n\n按需把文件[lib/socket.io-mp.js](lib/socket.io-mp.js)拷贝到工程目录下, 然后引入.\n\n## 相关项目\n\n- [socket.io-client](https://github.com/socketio/socket.io-client)\n- [mp-websocket](https://github.com/cytle/mp-websocket)\n- [engine.io-mp-client](https://github.com/cytle/engine.io-mp-client)\n\n## 关于单元测试\n\n该项目只是重新打包了`socket.io-client`,对于不同类型小程序兼容由`mp-websocket`提供.此项目暂无单元测试\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcytle%2Fsocket.io-mp-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcytle%2Fsocket.io-mp-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcytle%2Fsocket.io-mp-client/lists"}