<commit_before># signal-channel

A signal channel that empowers webrtc

## Motivation

WebRTC allows you to make a peer connection between two arbitary
    browsers. To be able to do so you need to exchange session
    descriptions that tell eachother where you are and how you
    can open a peer connection.

To exchange these session descriptions you need a signal channel.
    A server to which you can send descriptions and receive
    descriptions.

Once you've done the handshake through the signal channel you
    have an open peer to peer connection and don't need to deal
    with the signal channel server.

That's exactly what this is. It's a signal channel. It's hosted
    at `http://signalchannel.co/` and

Signal channel gives you a central end point which streams so
    you can easily make star shaped network topologies. That
    basically means everyone connects to the centralized signal
    channel server and the data flows through it to everyone.

## Echo Example

Let's say you want to send offers to other peers through the
signal channel.

```js
var echo = require("signal-channel/echo")
    , RemoteEvents = require("remote-events")

var stream1 = echo("optional namespace")
    , stream2 = echo("optional namespace")
    , ee1 = new RemoteEvents()
    , ee2 = new RemoteEvents()

stream1.pipe(ee1.getStream()).pipe(stream1)
stream2.pipe(ee2.getStream()).pipe(stream2)

ee1.on("offer", function (peer, offer) {
    console.log("got offer", offer, "from peer", peer)
})

ee2.emit("offer", "peer id #222", "this is an offer")
```<commit_msg>mention how badass the examples are<commit_after># signal-channel

A signal channel that empowers webrtc

## Motivation

WebRTC allows you to make a peer connection between two arbitary
    browsers. To be able to do so you need to exchange session
    descriptions that tell eachother where you are and how you
    can open a peer connection.

To exchange these session descriptions you need a signal channel.
    A server to which you can send descriptions and receive
    descriptions.

Once you've done the handshake through the signal channel you
    have an open peer to peer connection and don't need to deal
    with the signal channel server.

That's exactly what this is. It's a signal channel. It's hosted
    at `http://signalchannel.co/` and

Signal channel gives you a central end point which streams so
    you can easily make star shaped network topologies. That
    basically means everyone connects to the centralized signal
    channel server and the data flows through it to everyone.

## Echo Example

All the examples below work in either browser or node. You can
    run the examples in the examples folder with `node index.js`
    or `make build && open static/index.html`

Let's say you want to send offers to other peers through the
signal channel.

```js
var echo = require("signal-channel/echo")
    , RemoteEvents = require("remote-events")

var stream1 = echo("optional namespace")
    , stream2 = echo("optional namespace")
    , ee1 = new RemoteEvents()
    , ee2 = new RemoteEvents()

stream1.pipe(ee1.getStream()).pipe(stream1)
stream2.pipe(ee2.getStream()).pipe(stream2)

ee1.on("offer", function (peer, offer) {
    console.log("got offer", offer, "from peer", peer)
})

ee2.emit("offer", "peer id #222", "this is an offer")
```
{'fraction_non_alphanumeric': 0.07625337736415491, 'fraction_numerical': 0.009006304413089163, 'mean_word_length': 3.8359941944847606, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6450968', 'n_tokens_mistral': 921, 'n_tokens_neox': 890, 'n_words': 436}