1.0.8 • Published 4 years ago

stomp-websockets v1.0.8

Weekly downloads
205
License
Apache-2.0
Repository
github
Last release
4 years ago

stomp-websockets

A fork of Jeff Mesnil stomp-websocket adapted as a npm mobule and webpack compatible

How to use:

Fist, install stomp-websockets

npm install stomp-websockets --save
import Stomp from 'stomp-websockets'

let stomp = Stomp.client(serverURL)
let headers = {
    login: 'my login',
    passcode: 'my passcode',
    'client-id': 'myclientid'
}
stomp.connect(headers,
    () => { // On success
        stomp.subscribe(topicName, msg => {
            alert('Received message')
        })
    },
    error => { // On error
        console.log('STOMP Error - Connection')
        console.log(error)
        if (!stomp.connected) {
        setTimeout(function () {
            console.log('Connection: retry')
            // try to reconnect
        }, 10000) // 10 secondi
    }
})

How to build

This version of Stomp uses ES6 syntax. To transiple it in ES5 to support older browsers, use thi command:

npm run build

The generated javascript file is dist/Stomp.js

1.0.8

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago