-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
11,361 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2015 Kevin Jahns <[email protected]>. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
This is a WebRTC Connector for [Yjs](https://dadamonad.github.io/yjs/). It propagates document updates directly to all users via WebRTC. While WebRTC is not the most reliable connector, messages are propagated with almost no delay. | ||
|
||
* Very fast message propagation (not noticeable) | ||
* Very easy to use | ||
* Very little server load (you still have to set up a [signaling server](http://www.html5rocks.com/en/tutorials/webrtc/infrastructure/)) | ||
* Not suited for a large amount of collaborators | ||
* WebRTC is not supported in all browsers, and some have troubles communicating with each other | ||
|
||
We provide you with a free signaling server (it is used by default), but in production you should set up your own signaling server. You could use the [signalmaster](https://github.com/andyet/signalmaster) from &yet, which is very easy to set up. | ||
|
||
## Use it! | ||
Retrieve this with bower or npm, and use it as a js library or as a custom polymer element. | ||
|
||
##### NPM | ||
``` | ||
npm install y-webrtc --save | ||
``` | ||
and put it on the `Y` object. | ||
|
||
``` | ||
Y.WebRTC = require("y-webrtc"); | ||
``` | ||
|
||
##### Bower | ||
``` | ||
bower install y-webrtc --save | ||
``` | ||
|
||
##### Polymer | ||
On the website you find a bunch of examples on how you can use Yjs as polymer element. | ||
``` | ||
<link rel="import" href="../y-webrtc/y-webrtc.html"> | ||
<y-webrtc connector={{connector}} room="my-room-name"></y-webrtc> | ||
``` | ||
|
||
### Create the connection object | ||
This connector uses [SimpleWebRTC](https://simplewebrtc.com/) as an underlaying WebRTC framework, which supports the concept of rooms. | ||
|
||
``` | ||
var options = {}; | ||
var conn = new Y.WebRTC("my_room_name", options); // will connect to the default signaling server | ||
``` | ||
|
||
On the options object you can put the following properties: | ||
* url (optional) | ||
* Set the url of your signaling server. E.g. url = "https://yatta.ninja:8888" (which is the default endpoint) | ||
* debug (optional) | ||
* Whether to enable debugging mode (defaults to false) | ||
|
||
# Start Hacking | ||
This connector is also a nice starting point to build your own connector. The only 75 SLOCs of code are pretty well documented and understandable. If you have any troubles, don't hesitate to ask me for help! | ||
|
||
### Directory Structure | ||
* lib/ | ||
* Source files | ||
* build/browser | ||
* Unminified, but [browserified](http://browserify.org/) source files | ||
* build/node | ||
* npm modules | ||
|
||
|
||
## License | ||
Yjs is licensed under the [MIT License](./LICENSE.txt). | ||
|
||
<[email protected]> | ||
|
||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.