3.3.0 • Published 7 years ago

kalm-websocket v3.3.0

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
7 years ago

kalm-websocket

Websocket transport for kalm.js


kalm-websocket Node Build Status Dependencies Status

Install

npm install kalm-websocket

Usage

Setting up your server:

    const Kalm = require('kalm');
    const ws = require('kalm-websocket');
    
    const server = Kalm.listen({
        port: 3000,
        transport: ws
    });

    server.on('connection', (client) => {
        client.subscribe('/', (data) => {
            console.log(data);  // 'Hello from Browser!'
        });
    });
    

Using in your browser:

    // Install kalm and kalm-websocket via a package manager (recommended).
         
    import Kalm from 'kalm';
    import ws from 'kalm-websocket';
    
    const client = Kalm.connect({
        hostname: '127.0.0.1',  // Your server's hostname
        port: 3000,             // Your server's port
        adapter: ws
    });

    client.write('Hello from Browser');
    

Testing

npm test

Contribute

Please do! This is an open source project - if you see something that you want, open an issue or file a pull request.

If you have a major change, it would be better to open an issue first so that we can talk about it.

I am always looking for more maintainers, as well. Get involved.

License

Apache 2.0 (c) 2017 Frederic Charette

3.3.0

7 years ago

3.2.0

7 years ago

3.1.1

8 years ago

3.1.0

8 years ago

3.0.0

8 years ago

2.0.3

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.2.0

8 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago