{"id":14978166,"url":"https://github.com/socketio/socket.io-msgpack-parser","last_synced_at":"2025-05-07T16:09:04.036Z","repository":{"id":49604714,"uuid":"82646718","full_name":"socketio/socket.io-msgpack-parser","owner":"socketio","description":"Socket.IO parser based on msgpack","archived":false,"fork":false,"pushed_at":"2023-06-20T22:52:55.000Z","size":113,"stargazers_count":64,"open_issues_count":4,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-29T14:58:26.727Z","etag":null,"topics":["javascript","msgpack","nodejs","socket-io","socket-io-parser","websocket"],"latest_commit_sha":null,"homepage":"https://socket.io/docs/v4/custom-parser/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/socketio.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-02-21T06:51:13.000Z","updated_at":"2024-08-25T06:16:49.000Z","dependencies_parsed_at":"2024-01-23T21:40:05.910Z","dependency_job_id":null,"html_url":"https://github.com/socketio/socket.io-msgpack-parser","commit_stats":{"total_commits":37,"total_committers":3,"mean_commits":"12.333333333333334","dds":"0.18918918918918914","last_synced_commit":"af427ff928cec9f10e6589e71546f58349db5989"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketio%2Fsocket.io-msgpack-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketio%2Fsocket.io-msgpack-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketio%2Fsocket.io-msgpack-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketio%2Fsocket.io-msgpack-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/socketio","download_url":"https://codeload.github.com/socketio/socket.io-msgpack-parser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233352324,"owners_count":18663270,"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":["javascript","msgpack","nodejs","socket-io","socket-io-parser","websocket"],"created_at":"2024-09-24T13:56:58.526Z","updated_at":"2025-01-10T13:34:46.110Z","avatar_url":"https://github.com/socketio.png","language":"JavaScript","readme":"\n# socket.io-msgpack-parser\n\nAn alternative to the default [socket.io-parser](https://github.com/socketio/socket.io-parser), encoding and decoding packets with [msgpack](http://msgpack.org/).\n\nWith that parser, the browser build will be a bit heavier (an additional 7.5 KB minified, 3.0 KB gzipped), but each message will be smaller (sent as binary).\n\nPlease note that you MUST use the parser on both sides (server \u0026 client).\n\nSee also:\n\n- the default parser: https://github.com/socketio/socket.io-parser\n- a parser based on JSON.stringify/parse: https://github.com/darrachequesne/socket.io-json-parser\n\nCompatibility table:\n\n| Parser version | Socket.IO server version |\n|----------------| ------------------------ |\n| 2.x            | 1.x / 2.x                |\n| 3.x            | 3.x / 4.x                |\n\n## Usage\n\n```js\nconst io = require('socket.io');\nconst ioc = require('socket.io-client');\nconst customParser = require('socket.io-msgpack-parser');\n\nconst server = io(PORT, {\n  parser: customParser\n});\n\nconst socket = ioc('ws://localhost:' + PORT, {\n  parser: customParser\n});\n\nsocket.on('connect', () =\u003e {\n  socket.emit('hello');\n});\n```\n\n## Format\n\n`socket.emit('hello', 'you')` will create the following packet:\n\n```json\n{\n  \"type\": 2,\n  \"nsp\": \"/\",\n  \"data\": [\"hello\", \"you\"]\n}\n```\n\nwhich will be encoded by the parser as:\n\n`\u003cBuffer 83 a4 74 79 70 65 02 a3 6e 73 70 a1 2f a4 64 61 74 61 92 a5 68 65 6c 6c 6f a3 79 6f 75\u003e`\n\nMore information about the exchange protocol can be found [here](https://github.com/socketio/socket.io-protocol).\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocketio%2Fsocket.io-msgpack-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsocketio%2Fsocket.io-msgpack-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocketio%2Fsocket.io-msgpack-parser/lists"}