2.2.0 • Published 8 years ago

browser-websocket v2.2.0

Weekly downloads
9
License
MIT
Repository
github
Last release
8 years ago

Browser-websocket

This is packaging functions of browser websocket.

Example

  • node
var BrowserWebSocket = require('browser-websocket');
var ws = new BrowserWebSocket('ws://localhost:8000');

ws.on('open', function() {
    ws.emit('hello world');
});

ws.on('message', function(e) {
    var message = e.data;
    console.log(message);
});
  • html
<script src="browser-websocket.min.js"></script>
<script>
    var ws = new BrowserWebSocket('ws://localhost:8000');

    ws.on('open', function() {
        ws.emit('hello world');
    });

    ws.on('message', function(e) {
        var message = e.data;
        console.log(message);
    });
</script>

Installation

  • node install
npm install browser-websocket --save
  • use in html page

download "browser-websocket.min.js" (in dist folder)

<script src="browser-websocket.min.js"></script>

API Docs

See /doc/bws.md

License

Released under the MIT license

2.2.0

8 years ago

2.1.0

8 years ago

2.0.0

8 years ago

1.0.0

9 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago