Skip to content

Commit

Permalink
ready for 0.4.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
dmonad committed Feb 15, 2015
1 parent d5cf2c8 commit 3403829
Show file tree
Hide file tree
Showing 15 changed files with 11,361 additions and 95 deletions.
21 changes: 21 additions & 0 deletions LICENSE.txt
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.
67 changes: 67 additions & 0 deletions README.md
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]>


12 changes: 0 additions & 12 deletions build/browser/test.html

This file was deleted.

Loading

0 comments on commit 3403829

Please sign in to comment.