Skip to content

Commit

Permalink
docs(readme): remove deprecated API usage example
Browse files Browse the repository at this point in the history
  • Loading branch information
kalitine committed May 15, 2018
1 parent cb6dad5 commit 99c9b3d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ wg.onStateChange = (state) => {
// For example inviting a bot...
wg.invite('BOT_SERVER_WEB_SOCKET_URL')
break
case WebGroupState.LEAVING:
// Do something
break
case WebGroupState.LEFT:
// Do something
break
Expand Down
3 changes: 0 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ <h3 id="client-example">Client example</h3><pre><code class="lang-javascript"><c
// For example inviting a bot...
wg.invite(&apos;BOT_SERVER_WEB_SOCKET_URL&apos;)
break
case WebGroupState.LEAVING:
// Do something
break
case WebGroupState.LEFT:
// Do something
break
Expand Down
2 changes: 1 addition & 1 deletion docs/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -1466,7 +1466,7 @@
},
{
"kind": "index",
"content": "# Netflux\n\n![Netflux logo][logo]\n\nUniversal Javascript **peer to peer** transport API for client and server.\n\nSecure and fault tolerant full mesh peer to peer network based on **RTCDataChannel** and **WebSocket**.\n\nSend/receive **String** and **Uint8Array** data types.\n\nDocumentation: <https://coast-team.github.io/netflux>\n\n[![version](https://img.shields.io/npm/v/netflux.svg?style=flat-square)](https://www.npmjs.com/package/netflux)\n[![travis](https://travis-ci.org/coast-team/netflux.svg?branch=master)](https://travis-ci.org/coast-team/netflux)\n\n[![codeclimate](https://codeclimate.com/github/coast-team/netflux/badges/gpa.svg)](https://codeclimate.com/github/coast-team/netflux)\n[![documentation](https://coast-team.github.io/netflux/badge.svg)](https://coast-team.github.io/netflux)\n\n[![commitizen](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)](http://commitizen.github.io/cz-cli)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release)\n[![gitter](https://img.shields.io/badge/GITTER-join%20chat-green.svg?style=flat-square)](https://gitter.im/coast-team/netflux?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n\n![Netflux example][netflux_example]\n\n## Features\n\n* Peer to peer full mesh network which accepts connection failures between some peers.\n* If connection between two members failed, other members will retransmit messages for them.\n* Automatic rejoin the group if connection lost.\n* Automatic selection between [WebSocket][websocket] & [RTCDataChannel][rtcdatachannel].\n* Possible to have mixed members: clients (Chrome, Firefox) and servers (NodeJS bot).\n* Send private or broadcast [String][string], [Uint8Array][uint8array] data types.\n* Possible to send data > 1MB.\n* All connections are encrypted.\n* Full control over WebRTC servers: Signaling, STUN and TURN.\n * Deploy your own Signaling server ([Sigver][sigver]) or use one provided by default.\n * Configure STUN and TURN servers.\n* Small Signaling server payload.\n* Signaling server is used only to establish connection between two peers, no user data is passing through it.\n* Universal API (works in Chrome/Firefox and NodeJS).\n* TypeScript declaration files are included.\n* Simple and familiar API usage.\n* 4 builds (ES5 code):\n * `dist/netflux.cjs.js` CommonJS format for NodeJS (see _package.json#main_).\n * `dist/esm/index.node.js` ES module format for NodeJS (see _package.json#module_).\n * `dist/esm/index.browser.js` ES module format for browsers (see _package.json#browser_).\n * `dist/netflux.umd.js` UMD format for browsers.\n\n## Usage\n\nHere is a basic usage example for client and server (checkout the [documenation](https://coast-team.github.io/netflux) for more details).\n\n> It is possible to have only clients without any bot server as his is not a mandatory member, but like any other group member.\n\n### Client example\n\n```javascript\nimport { WebGroup, WebGroupState } from 'netflux'\n\n// Create instance and set callbacks\nconst wg = new WebGroup()\nwg.onMemberJoin = (id) => {\n console.log('Member ' + id + ' has joined')\n console.log('All members are: ', wg.members)\n}\nwg.onMemberLeave = (id) => {\n console.log('Member ' + id + ' has left')\n console.log('All members are: ', wg.members)\n}\nwg.onMessage = (id, data) => {\n console.log(`Message from ${id} group member`, data)\n}\nwg.onStateChange = (state) => {\n console.log('The new Group state is ', state)\n switch (state) {\n case WebGroupState.JOINING:\n // Do something\n break\n case WebGroupState.JOINED:\n // Do something\n // For example inviting a bot...\n wg.invite('BOT_SERVER_WEB_SOCKET_URL')\n break\n case WebGroupState.LEAVING:\n // Do something\n break\n case WebGroupState.LEFT:\n // Do something\n break\n }\n}\n\n// Join the group\nwg.join('MY_UNIQUE_KEY_FOR_THE_GROUP')\n```\n\n### Bot example\n\n```javascript\nimport { Bot } from 'netflux'\nconst http = require('http') // https is also possible\nconst server = http.createServer()\n\nconst bot = new WebGroupBotServer({\n server: server,\n webGroupOptions: {\n // Any WebGroup options like for a client\n },\n})\n\nbot.onWebGroup = (wg) => {\n // New instance of a WebGroup (Someone has invited this bot).\n // See example above for client as it is the same API.\n}\n\nserver.listen(BOT_PORT, _BOT_HOST)\n// A client may invite this bot with the following URL: 'ws://BOT_HOST:BOT_PORT'\n```\n\n## Demo\n\nNetflux is used by our team for Multi User Text Editor ([MUTE repo](https://github.com/coast-team/mute)) development. The demo version is available on: <https://coedit.re>.\n\n[websocket]: https://developer.mozilla.org/en/docs/Web/API/WebSocket\n[rtcdatachannel]: https://developer.mozilla.org/en/docs/Web/API/RTCDataChannel\n[string]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String\n[uint8array]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\n[sigver]: https://github.com/coast-team/sigver\n[commitizen]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square\n[commitizen-url]: http://commitizen.github.io/cz-cli\n[codeclimate]: https://codeclimate.com/github/coast-team/netflux/badges/gpa.svg\n[codeclimate-url]: https://codeclimate.com/github/coast-team/netflux\n[coverage]: https://codeclimate.com/github/coast-team/netflux/badges/coverage.svg\n[coverage-url]: https://codeclimate.com/github/coast-team/netflux/coverage\n[doc]: https://coast-team.github.io/netflux/badge.svg\n[doc-url]: https://coast-team.github.io/netflux/netflux\n[logo]: manual/asset/logo_760px.png\n[netflux_example]: manual/asset/example.png\n",
"content": "# Netflux\n\n![Netflux logo][logo]\n\nUniversal Javascript **peer to peer** transport API for client and server.\n\nSecure and fault tolerant full mesh peer to peer network based on **RTCDataChannel** and **WebSocket**.\n\nSend/receive **String** and **Uint8Array** data types.\n\nDocumentation: <https://coast-team.github.io/netflux>\n\n[![version](https://img.shields.io/npm/v/netflux.svg?style=flat-square)](https://www.npmjs.com/package/netflux)\n[![travis](https://travis-ci.org/coast-team/netflux.svg?branch=master)](https://travis-ci.org/coast-team/netflux)\n\n[![codeclimate](https://codeclimate.com/github/coast-team/netflux/badges/gpa.svg)](https://codeclimate.com/github/coast-team/netflux)\n[![documentation](https://coast-team.github.io/netflux/badge.svg)](https://coast-team.github.io/netflux)\n\n[![commitizen](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)](http://commitizen.github.io/cz-cli)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release)\n[![gitter](https://img.shields.io/badge/GITTER-join%20chat-green.svg?style=flat-square)](https://gitter.im/coast-team/netflux?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n\n![Netflux example][netflux_example]\n\n## Features\n\n* Peer to peer full mesh network which accepts connection failures between some peers.\n* If connection between two members failed, other members will retransmit messages for them.\n* Automatic rejoin the group if connection lost.\n* Automatic selection between [WebSocket][websocket] & [RTCDataChannel][rtcdatachannel].\n* Possible to have mixed members: clients (Chrome, Firefox) and servers (NodeJS bot).\n* Send private or broadcast [String][string], [Uint8Array][uint8array] data types.\n* Possible to send data > 1MB.\n* All connections are encrypted.\n* Full control over WebRTC servers: Signaling, STUN and TURN.\n * Deploy your own Signaling server ([Sigver][sigver]) or use one provided by default.\n * Configure STUN and TURN servers.\n* Small Signaling server payload.\n* Signaling server is used only to establish connection between two peers, no user data is passing through it.\n* Universal API (works in Chrome/Firefox and NodeJS).\n* TypeScript declaration files are included.\n* Simple and familiar API usage.\n* 4 builds (ES5 code):\n * `dist/netflux.cjs.js` CommonJS format for NodeJS (see _package.json#main_).\n * `dist/esm/index.node.js` ES module format for NodeJS (see _package.json#module_).\n * `dist/esm/index.browser.js` ES module format for browsers (see _package.json#browser_).\n * `dist/netflux.umd.js` UMD format for browsers.\n\n## Usage\n\nHere is a basic usage example for client and server (checkout the [documenation](https://coast-team.github.io/netflux) for more details).\n\n> It is possible to have only clients without any bot server as his is not a mandatory member, but like any other group member.\n\n### Client example\n\n```javascript\nimport { WebGroup, WebGroupState } from 'netflux'\n\n// Create instance and set callbacks\nconst wg = new WebGroup()\nwg.onMemberJoin = (id) => {\n console.log('Member ' + id + ' has joined')\n console.log('All members are: ', wg.members)\n}\nwg.onMemberLeave = (id) => {\n console.log('Member ' + id + ' has left')\n console.log('All members are: ', wg.members)\n}\nwg.onMessage = (id, data) => {\n console.log(`Message from ${id} group member`, data)\n}\nwg.onStateChange = (state) => {\n console.log('The new Group state is ', state)\n switch (state) {\n case WebGroupState.JOINING:\n // Do something\n break\n case WebGroupState.JOINED:\n // Do something\n // For example inviting a bot...\n wg.invite('BOT_SERVER_WEB_SOCKET_URL')\n break\n case WebGroupState.LEFT:\n // Do something\n break\n }\n}\n\n// Join the group\nwg.join('MY_UNIQUE_KEY_FOR_THE_GROUP')\n```\n\n### Bot example\n\n```javascript\nimport { Bot } from 'netflux'\nconst http = require('http') // https is also possible\nconst server = http.createServer()\n\nconst bot = new WebGroupBotServer({\n server: server,\n webGroupOptions: {\n // Any WebGroup options like for a client\n },\n})\n\nbot.onWebGroup = (wg) => {\n // New instance of a WebGroup (Someone has invited this bot).\n // See example above for client as it is the same API.\n}\n\nserver.listen(BOT_PORT, _BOT_HOST)\n// A client may invite this bot with the following URL: 'ws://BOT_HOST:BOT_PORT'\n```\n\n## Demo\n\nNetflux is used by our team for Multi User Text Editor ([MUTE repo](https://github.com/coast-team/mute)) development. The demo version is available on: <https://coedit.re>.\n\n[websocket]: https://developer.mozilla.org/en/docs/Web/API/WebSocket\n[rtcdatachannel]: https://developer.mozilla.org/en/docs/Web/API/RTCDataChannel\n[string]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String\n[uint8array]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\n[sigver]: https://github.com/coast-team/sigver\n[commitizen]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square\n[commitizen-url]: http://commitizen.github.io/cz-cli\n[codeclimate]: https://codeclimate.com/github/coast-team/netflux/badges/gpa.svg\n[codeclimate-url]: https://codeclimate.com/github/coast-team/netflux\n[coverage]: https://codeclimate.com/github/coast-team/netflux/badges/coverage.svg\n[coverage-url]: https://codeclimate.com/github/coast-team/netflux/coverage\n[doc]: https://coast-team.github.io/netflux/badge.svg\n[doc-url]: https://coast-team.github.io/netflux/netflux\n[logo]: manual/asset/logo_760px.png\n[netflux_example]: manual/asset/example.png\n",
"longname": "/home/philippe/workspace/netflux/README.md",
"name": "./README.md",
"static": true,
Expand Down
6 changes: 3 additions & 3 deletions docs/source.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@
<td class="coverage"><span data-ice="coverage">100 %</span><span data-ice="coverageCount" class="coverage-count">9/9</span></td>
<td style="display: none;" data-ice="size">5223 byte</td>
<td style="display: none;" data-ice="lines">145</td>
<td style="display: none;" data-ice="updated">2018-05-03 11:32:31 (UTC)</td>
<td style="display: none;" data-ice="updated">2018-05-03 11:38:30 (UTC)</td>
</tr>
<tr data-ice="file">
<td data-ice="filePath"><span><a href="file/src/WebChannelFacade.js.html">src/WebChannelFacade.js</a></span></td>
<td data-ice="identifier" class="identifiers"><span><a href="class/src/WebChannelFacade.js~WebGroup.html">WebGroup</a></span></td>
<td class="coverage"><span data-ice="coverage">100 %</span><span data-ice="coverageCount" class="coverage-count">22/22</span></td>
<td style="display: none;" data-ice="size">10246 byte</td>
<td style="display: none;" data-ice="lines">303</td>
<td style="display: none;" data-ice="updated">2018-05-03 11:32:31 (UTC)</td>
<td style="display: none;" data-ice="updated">2018-05-03 11:38:30 (UTC)</td>
</tr>
<tr data-ice="file">
<td data-ice="filePath"><span><a href="file/src/index.common.doc.js.html">src/index.common.doc.js</a></span></td>
Expand All @@ -88,7 +88,7 @@
<td class="coverage"><span data-ice="coverage">100 %</span><span data-ice="coverageCount" class="coverage-count">21/21</span></td>
<td style="display: none;" data-ice="size">5544 byte</td>
<td style="display: none;" data-ice="lines">182</td>
<td style="display: none;" data-ice="updated">2018-05-03 11:32:31 (UTC)</td>
<td style="display: none;" data-ice="updated">2018-05-03 11:38:30 (UTC)</td>
</tr>
</tbody>
</table>
Expand Down

0 comments on commit 99c9b3d

Please sign in to comment.