Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/geky/comm.io-client
Client for direct browser-to-browser communication
https://github.com/geky/comm.io-client
Last synced: 1 day ago
JSON representation
Client for direct browser-to-browser communication
- Host: GitHub
- URL: https://github.com/geky/comm.io-client
- Owner: geky
- License: mit
- Created: 2014-01-17T05:59:52.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-01-25T04:11:32.000Z (almost 11 years ago)
- Last Synced: 2024-04-14T18:43:14.850Z (7 months ago)
- Language: JavaScript
- Size: 176 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# comm.io-client #
Layer for direct browser-to-browser communication over Engine.IO and WebRTC.
This is the client-side script for [comm.io](http://github.com/geky/comm.io)
## Example Usage ##
The following example creates a simple chat program in the console.
```js
var comm = cio()comm.on('connect', function(comm) {
comm.on('chat', function(data) {
console.log('>', data)
})
})function send(data) {
comm.emit('chat', data)
}
```All that is required on the server side is a hook into an http server
```js
var server = require('http').Server()
var comm = require('comm.io').attach(server)server.listen(3000)
```