2.2.0 • Published 6 years ago

browser-websocket v2.2.0

Weekly downloads
9
License
MIT
Repository
github
Last release
6 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

6 years ago

2.1.0

6 years ago

2.0.0

7 years ago

1.0.0

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago