{"id":24379689,"url":"https://github.com/y-js/y-websockets-client","last_synced_at":"2025-04-10T21:10:03.090Z","repository":{"id":57402748,"uuid":"45806386","full_name":"y-js/y-websockets-client","owner":"y-js","description":"Websocket connector for Yjs (Browser/Node client)","archived":false,"fork":false,"pushed_at":"2018-02-28T00:37:24.000Z","size":2503,"stargazers_count":21,"open_issues_count":3,"forks_count":10,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-10T21:09:56.734Z","etag":null,"topics":["yjs","yjs-connector"],"latest_commit_sha":null,"homepage":null,"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/y-js.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":"2015-11-09T00:46:15.000Z","updated_at":"2025-01-09T17:12:43.000Z","dependencies_parsed_at":"2022-08-30T20:01:08.546Z","dependency_job_id":null,"html_url":"https://github.com/y-js/y-websockets-client","commit_stats":null,"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y-js%2Fy-websockets-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y-js%2Fy-websockets-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y-js%2Fy-websockets-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y-js%2Fy-websockets-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/y-js","download_url":"https://codeload.github.com/y-js/y-websockets-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248298321,"owners_count":21080320,"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":["yjs","yjs-connector"],"created_at":"2025-01-19T07:18:46.741Z","updated_at":"2025-04-10T21:10:03.070Z","avatar_url":"https://github.com/y-js.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Websockets Connector for [Yjs](https://github.com/y-js/yjs) (Client)\n\nWith the websockets connector you can set up a central server that saves changes and communicates with clients (see [y-websockets-server](https://github.com/y-js/y-websockets-server)).\nThis option is very similar to other shared editing frameworks that require a central server. Because the websocket connector is build on top of [socket.io](http://socket.io),\nthis connector is a rock solid choice if you require high reliability.\n\n* Extremely reliable\n* Very easy to use\n* Some server load\n* You can set up a central server that persists changes\n* Falls back to http-communication, if websockets are not supported\n* Works with nodejs and in the browser\n\n\n## Use it!\nRetrieve this with bower or npm. Note: You need to set up a \n[y-websockets-server](https://github.com/y-js/y-websockets-server) that acts as a central server.\nYou should use the default connection endpoint only for testing! If the `url` property is not set,\nthe default connection endpoint is chosen (provided by the i5 chair of informatics, RTWH University).\n\n##### NPM\n```\nnpm install y-websockets-client --save\n```\n\n##### Bower\n```\nbower install y-websockets-client --save\n```\n\n### Example\n\n```\nY({\n  db: {\n    name: 'memory' // use the memory db adapter\n  },\n  connector: {\n    name: 'websockets-client', // use the websockets-client connector\n    room: 'Textarea-example-dev',\n    // socket: io('http://localhost:1234') // Pass socket.io object to use\n    // url: http://localhost:1234 // the connection endpoint (see y-websockets-server)\n    // if `url` is not set, the default connection endpoint is chosen\n    // (provided by the i5 chair of computer science, RTWH University)\n  },\n  share: {\n    textarea: 'Text' // y.share.textarea is of type Y.Text\n  }\n}).then(function (y) {\n  // bind the textarea to a shared text element\n  y.share.textarea.bind(document.getElementById('textfield'))\n}\n```\n\n## License\nYjs is licensed under the [MIT License](./LICENSE).\n\n\u003ckevin.jahns@rwth-aachen.de\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fy-js%2Fy-websockets-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fy-js%2Fy-websockets-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fy-js%2Fy-websockets-client/lists"}