GithubHelp home page GithubHelp logo

rabbitmq / rabbitmq-web-stomp-examples Goto Github PK

View Code? Open in Web Editor NEW
94.0 28.0 76.0 639 KB

Home Page: https://www.rabbitmq.com/

License: Other

Makefile 61.74% HTML 33.03% CSS 1.64% Erlang 3.59%
rabbitmq rabbitmq-plugin websockets stomp

rabbitmq-web-stomp-examples's Introduction

RabbitMQ Web STOMP Examples

This repository has been moved to the main unified RabbitMQ "monorepo", including all open issues. You can find the source under /deps/rabbitmq_web_stomp_examples. All issues have been transferred.

Introduction

This project contains few basic examples of RabbitMQ Web STOMP plugin usage.

Once installed the server will bind to port 15670 and serve few static HTML files on port 15670 (e.g. http://127.0.0.1:15670).

Installation

This plugin ships with RabbitMQ. Enabled it using CLI tools:

rabbitmq-plugins enable rabbitmq_web_stomp_examples

rabbitmq-web-stomp-examples's People

Contributors

acogoluegnes avatar dcorbacho avatar dumbbell avatar essen avatar gerhard avatar jmesnil avatar kjnilsson avatar lukebakken avatar michaelklishin avatar rade avatar spring-operator avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rabbitmq-web-stomp-examples's Issues

Send breaks if body contains multi-byte utf-8 characters

In stomp.js, the Frame.prototype.toString function sets the content-length to the number of characters in the body. This is only valid if there is one byte per character.

I added the following function to calculate the number of bytes in the body:

function countBytes(string) {
  var escapedStr = encodeURI(string);
  if (escapedStr.indexOf("%") != -1) {
    var count = escapedStr.split("%").length - 1;
    if (count == 0) count++;
    var tmp = escapedStr.length - (count * 3);
    return count + tmp;
  }
  else return escapedStr.length;
}

and changed

lines.push("content-length:" + ('' + this.body).length);

to

lines.push("content-length:" + countBytes('' + this.body));

Maybe there is a cleaner way of doing this. But this change worked for me.
There is possibly more issues of this type in stomp.js. The .length gives the number of characters and not the number of bytes in a string.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.