{"id":14384550,"url":"https://github.com/libp2p/js-libp2p-websocket-star","last_synced_at":"2025-08-23T17:32:45.270Z","repository":{"id":57230763,"uuid":"101663090","full_name":"libp2p/js-libp2p-websocket-star","owner":"libp2p","description":"libp2p-webrtc-star without webrtc. Just plain socket.io.","archived":true,"fork":false,"pushed_at":"2020-12-12T15:29:41.000Z","size":533,"stargazers_count":39,"open_issues_count":16,"forks_count":15,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-12-15T20:43:58.600Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://libp2p.io","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/libp2p.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-08-28T16:21:47.000Z","updated_at":"2023-01-28T10:22:13.000Z","dependencies_parsed_at":"2022-09-04T17:51:41.042Z","dependency_job_id":null,"html_url":"https://github.com/libp2p/js-libp2p-websocket-star","commit_stats":null,"previous_names":["mkg20001/js-libp2p-websocket-star"],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libp2p%2Fjs-libp2p-websocket-star","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libp2p%2Fjs-libp2p-websocket-star/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libp2p%2Fjs-libp2p-websocket-star/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libp2p%2Fjs-libp2p-websocket-star/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libp2p","download_url":"https://codeload.github.com/libp2p/js-libp2p-websocket-star/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230716555,"owners_count":18269790,"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-08-28T18:01:28.123Z","updated_at":"2024-12-21T12:30:42.025Z","avatar_url":"https://github.com/libp2p.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# ⛔️ DEPRECATED\n\nlibp2p-websocket-star is not supported anymore from [libp2p@0.27.0](https://github.com/libp2p/js-libp2p/releases/tag/v0.27.0).  \n👉 If you are looking for a drop-in replacement, use [libp2p-webrtc-star](https://github.com/libp2p/js-libp2p-webrtc-star) instead.  \nCheck [js-libp2p/doc/CONFIGURATION.md](https://github.com/libp2p/js-libp2p/blob/master/doc/CONFIGURATION.md) for what other modules are currently supported.\n\n_This library will not be maintained._\n\n---\n\n# libp2p-websocket-star\n\n[![](https://img.shields.io/badge/made%20by-mkg20001-blue.svg?style=flat-square)](http://protocol.ai)\n[![](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)\n[![](https://img.shields.io/badge/freenode-%23libp2p-yellow.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23libp2p)\n[![Discourse posts](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg)](https://discuss.libp2p.io)\n[![](https://img.shields.io/codecov/c/github/libp2p/js-libp2p-websocket-star.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-websocket-star)\n[![](https://img.shields.io/travis/libp2p/js-libp2p-websocket-star.svg?style=flat-square)](https://travis-ci.com/libp2p/js-libp2p-websocket-star)\n[![Dependency Status](https://david-dm.org/libp2p/js-libp2p-websocket-star.svg?style=flat-square)](https://david-dm.org/libp2p/js-libp2p-websocket-star)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)\n\n[![](https://raw.githubusercontent.com/libp2p/interface-transport/master/img/badge.png)](https://github.com/libp2p/interface-transport)\n[![](https://raw.githubusercontent.com/libp2p/interface-connection/master/img/badge.png)](https://github.com/libp2p/interface-connection)\n[![](https://github.com/libp2p/interface-peer-discovery/raw/master/img/badge.png)](https://github.com/libp2p/interface-peer-discovery)\n\n\u003e libp2p-webrtc-star without webrtc. Just  WebSockets with a relay point in the middle.\n\n## Lead Maintainer\n\n[Jacob Heun](https://github.com/jacobheun)\n\n## Description\n\n`libp2p-websocket-star` is one of the multiple transports available for libp2p. `libp2p-websocket-star` incorporates both a transport and a discovery service that is facilitated by the rendezvous server, also available in this repo and module.\n\n## Usage\n\n### Example\n\n```\nTODO\n```\n\n### Install\n\n```bash\n\u003e npm install libp2p-websocket-star\n```\n\n### API\n\n### Transport\n\n[![](https://raw.githubusercontent.com/libp2p/interface-transport/master/img/badge.png)](https://github.com/libp2p/interface-transport)\n\n### Connection\n\n[![](https://raw.githubusercontent.com/libp2p/interface-connection/master/img/badge.png)](https://github.com/libp2p/interface-connection)\n\n### Peer Discovery - `ws.discovery`\n\n[![](https://github.com/libp2p/interface-peer-discovery/raw/master/img/badge.png)](https://github.com/libp2p/interface-peer-discovery)\n\n### Example\n\n```js\nconst libp2p = require(\"libp2p\")\nconst Id = require(\"peer-id\")\nconst Info = require(\"peer-info\")\nconst multiaddr = require(\"multiaddr\")\nconst pull = require('pull-stream')\n\nconst WSStar = require('libp2p-websocket-star')\n\nId.create((err, id) =\u003e {\n  if (err) throw err\n\n  const peerInfo = new Info(id)\n  peerInfo.multiaddrs.add(multiaddr(\"/dns4/ws-star-signal-1.servep2p.com/tcp/443/wss/p2p-websocket-star/\"))\n\n  // TODO -\u003e review why the ID can not be passed by the .listen call\n  const ws = new WSStar({ id: id }) // the id is required for the crypto challenge\n\n  const modules = {\n    transport: [\n      ws\n    ],\n    discovery: [\n      ws.discovery\n    ]\n  }\n\n  const node = new libp2p(modules, peerInfo)\n\n  node.handle(\"/test/1.0.0\", (protocol, conn) =\u003e {\n    pull(\n      pull.values(['hello']),\n      conn,\n      pull.map((s) =\u003e s.toString()),\n      pull.log()\n    )\n  })\n\n  node.start((err) =\u003e {\n    if (err) {\n      throw err\n    }\n\n    node.dial(peerInfo, \"/test/1.0.0\", (err, conn) =\u003e {\n      if (err) {\n        throw err\n      }\n\n      pull(\n        pull.values(['hello from the other side']),\n        conn,\n        pull.map((s) =\u003e s.toString()),\n        pull.log()\n      )\n    })\n  })\n})\n```\n\nOutputs:\n```\nhello\nhello from the other side\n```\n\n## [Rendezvous server](https://github.com/libp2p/js-libp2p-websocket-star-rendezvous#usage)\n\n## Usage\n\nTo reduce dependencies `libp2p-websocket-star` comes without the rendezvous server, that means that you need to install `libp2p-websocket-star-rendezvous` to start a rendezvous server. To do that, first install the module globally in your machine with:\n\n```bash\n\u003e npm install --global libp2p-websocket-star-rendezvous\n```\n\nThis will install a `rendezvous` CLI tool. Now you can spawn the server with:\n\n```bash\n\u003e rendezvous --port=9090 --host=127.0.0.1\n```\n\nDefaults:\n\n- `port` - 13579\n- `host` - '0.0.0.0'\n\n## Hosted Rendezvous server\n\nWe host a rendezvous server at `/dns4/ws-star.discovery.libp2p.io` that can be used for practical demos and experimentation, it **should not be used for apps in production**.\n\nA libp2p-websocket-star address, using the signalling server we provide, looks like:\n\n`/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star/ipfs/\u003cyour-peer-id\u003e`\n\nNote: The address above indicates WebSockets Secure, which can be accessed from both http and https.\n\nLICENSE MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibp2p%2Fjs-libp2p-websocket-star","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibp2p%2Fjs-libp2p-websocket-star","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibp2p%2Fjs-libp2p-websocket-star/lists"}