Mixin: Stomp

Defined in: src/stomp.coffee

Overview

Stomp exposes methods to instantiate Client.

Method Summary

Method Details

~ (void) client(url, protocols = ['v10.stomp', 'v11.stomp', 'v12.stomp'])

This method creates a WebSocket client that is connected to the STOMP server located at the url.

Examples:

     var url = "ws://localhost:61614/stomp";
     var client = Stomp.client(url);

Parameters:

  • url ( String )

~ (void) over(ws)

Note: If you need auto reconnect feature you must pass a function that returns a WebSocket or similar Object

This method is an alternative to Stomp.client() to let the user specify the WebSocket to use (either a standard HTML5 WebSocket or a similar object).

In order to support reconnection, the function Client._connect should be callable more than once. While reconnecting a new instance of underlying transport (TCP Socket, WebSocket or SockJS) will be needed. So, this function alternatively allows passing a function that should return a new instance of the underlying socket.

Examples:

      var client = Stomp.over(function(){
        return new WebSocket('ws://localhost:15674/ws')
      });

Parameters:

  • ws ( WebSocket|function() ) a WebSocket like Object or a function returning a WebObject or similar Object

    Quickly fuzzy find classes, mixins, methods, file:

    Control the navigation frame:

    You can focus and blur the search input: