aedes | Barebone MQTT broker that can run on any stream server | Websocket library

 by   moscajs JavaScript Version: 0.51.2 License: MIT

kandi X-RAY | aedes Summary

kandi X-RAY | aedes Summary

aedes is a JavaScript library typically used in Networking, Websocket, Docker applications. aedes has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can install using 'npm i aedes' or download it from GitHub, npm.

Barebone MQTT broker that can run on any stream server, the node way
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              aedes has a medium active ecosystem.
              It has 1608 star(s) with 220 fork(s). There are 46 watchers for this library.
              There were 1 major release(s) in the last 6 months.
              There are 48 open issues and 332 have been closed. On average issues are closed in 90 days. There are 12 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of aedes is 0.51.2

            kandi-Quality Quality

              aedes has 0 bugs and 0 code smells.

            kandi-Security Security

              aedes has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              aedes code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              aedes is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              aedes releases are available to install and integrate.
              Deployable package is available in npm.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed aedes and discovered the below as its top functions. This is intended to give you an instant insight into aedes implemented functionality, and help decide if they suit your requirements.
            • Pushes a message to the queue .
            Get all kandi verified functions for this library.

            aedes Key Features

            No Key Features are available at this moment for aedes.

            aedes Examples and Code Snippets

            aedes-stats,Example
            JavaScriptdot img1Lines of Code : 5dot img1License : Permissive (MIT)
            copy iconCopy
            var aedes = require('aedes')
            var stats = require('aedes-stats')
            var instance = aedes()
            
            stats(instance)
              
            aedes-persistence-redis,Install
            JavaScriptdot img2Lines of Code : 1dot img2License : Permissive (MIT)
            copy iconCopy
            npm install aedes aedes-persistence-redis --save
              
            aedes-stats,Install
            JavaScriptdot img3Lines of Code : 1dot img3License : Permissive (MIT)
            copy iconCopy
            npm i aedes aedes-stats --save
              
            Connect to MQTT Broker With Device and Browser
            JavaScriptdot img4Lines of Code : 17dot img4License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            const aedes = require('aedes')()
            const server = require('net').createServer(aedes.handle)
            const httpServer = require('http').createServer()
            const ws = require('websocket-stream')
            const port = 1883
            const wsPort = 8883 
            
            server.listen(port, 
            Can't connect to aedes MQTT broker
            JavaScriptdot img5Lines of Code : 44dot img5License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            const aedes = require('aedes')();
            const server = require('net').createServer(aedes.handle);
            const port = 1883;
            
            // exports.startBroker = function() {
            const startBroker = function() {
                return new Promise((res, rej) => {
                    server

            Community Discussions

            QUESTION

            MQTT TLS connection
            Asked 2022-Mar-01 at 20:20

            I would like to connect a test MQTT-Client to my Node.js application as a MQTT-Broker. I am using the aedes library from moscajs

            My MQTT-Client is the tool "MQTT-Explorer" and here is my Node.js application:

            ...

            ANSWER

            Answered 2022-Mar-01 at 20:20

            MQTT Explorer is built using Node.js and the MQTT library MQTT.js. As per this issue:

            Node.js requires the IP address to be in the subjectAltNames for the cert and not in the CN. Maybe MQTT.fx isn't requiring that, but it should.

            and:

            If your server's certificate says CN=localhost in the Subject field, connect using localhost and not 127.0.0.1 and it should work. If it says CN=127.0.0.1, you have to make a new one because Node.js won't validate the IP address unless it's in the SAN extension. There is a way to work around it in code (I think it's an option called checkServerIdentity), but I would prefer to fix my certificate if I had this problem.

            A rationale for the approach taken in Node is set out in this answer which includes the following quote from RFC2818: HTTP Over TLS :

            In some cases, the URI is specified as an IP address rather than a hostname. In this case, the iPAddress subjectAltName must be present in the certificate and must exactly match the IP in the URI.

            As you are using MQTT over TLS (as opposed to HTTP Over TLS) you could argue that the above does not apply but, given that the main use of the TLS library is for HTTP traffic, it makes sense that it confirms to the RFC by default.

            You have a few options including:

            • Use a hostname (e.g. localhost) rather then an IP when creating the certificate/connecting.
            • Add the IP as a subjectAltName
            • Modify the library to use a noop checkServerIdentity (see this answer).
            • Use another application for testing (not really recommended as some applications will work and others will not). The issue quoted above mentions that MQTT.fx works.

            Source https://stackoverflow.com/questions/71312809

            QUESTION

            JavaScript/HTML Word Guessing Game: difficulty levels w/drop-down
            Asked 2021-Dec-02 at 00:06

            I am working on a project to have a random word guessing game. So far most of the code is working but I am trying to implement some rules on the length of words displayed to the user as a measure of game difficulty (shorter words = easier, etc). I am using a drop-down menu to get the user's setting selection, and then have rules in the JS tags that are supposed to be handling this.

            After toying around with this for several days, I was hoping that a fresh pair of eyes might have a suggestion about where I am going wrong to be able to enforce the rules I am trying to enforce?

            The specific functions that should be handling this are setDifficulty(), getSelection(), and randomWord()

            ...

            ANSWER

            Answered 2021-Dec-02 at 00:06

            Let's start by saving the difficulty setting in a variable along these :

            Source https://stackoverflow.com/questions/70192625

            QUESTION

            Periodic client disconnections in MQTT NodeJS server on websockets when deployed to Google Cloud Run
            Asked 2021-Sep-17 at 08:02

            I have a Node JS MQTT server running on websockets and deployed to Cloud Run. This server uses Aedes MQTT Broker library (https://github.com/moscajs/aedes). Clients connect to this server on port 443. Everything works ok, but periodically each client is disconnected from the MQTT Broker (aprox. every 5 minutes since each client first connected) This does not happen when the server is deployed to a dedicated machine or a Google Cloud VM, only happens when deployed to Google Cloud Run.

            To illustrate the problem, I have written in NodeJS a super simple MQTT server, which allows any client to connect and echoes to queue "responses" any message that the client sends to queue "messages" and a NodeJS script to test it. You may find the full 2-files project in https://github.com/madomingo/mqtt_test/tree/main

            The server code is:

            ...

            ANSWER

            Answered 2021-Sep-17 at 08:02

            As per the comments the docs say:

            WebSockets requests are treated as long-running HTTP requests in Cloud Run. They are subject to request timeouts (currently up to 60 minutes and defaults to 5 minutes) even if your application server does not enforce any timeouts.

            Accordingly, if the client keeps the connection open longer than the required timeout configured for the Cloud Run service, the client will be disconnected when the request times out.

            Therefore, WebSockets clients connecting to Cloud Run should handle reconnecting to the server if the request times out or the server disconnects. You can achieve this in browser-based clients by using libraries such as reconnecting-websocket or by handling "disconnect" events if you are using the SocketIO library.

            This will apply to MQTT over WebSockets so changing the timeout will allow longer connections but you should also ensure that the client is automatically reconnecting when the connection does go down.

            Source https://stackoverflow.com/questions/69212573

            QUESTION

            Is it possible to have external IOT device publish to IBM cloud node-red aedes mqtt broker?
            Asked 2021-Sep-02 at 07:56

            I am new to MQTT. Is it possible to have an external IOT device that can publish it's readings in MQTT format and use the aedes MQTT broker node and a subscriber node in node-red that is installed in the IBM cloud environment to receive the payloads?

            Currently I have a simple setup within node-red with the publish and subscribe nodes when using the 'localhost:1883' as a server address. Do I need to have a server with IP address to make this work?

            Where do I start?

            ...

            ANSWER

            Answered 2021-Sep-02 at 07:56

            Short answer, no.

            You can only access Node-RED running on IBM Cloud via HTTP/HTTPS, you will not be able to connect to the any broker you ran in the Node-RED process externally.

            This is because the Node-RED instance is behind a reverse HTTP/HTTPS proxy.

            You could deploy Node-RED in a Docker container or on a Virtual machine, or just make use of an external MQTT broker. But without a much better understanding of the whole problem you are trying to solve it is impossible to be more specific.

            Source https://stackoverflow.com/questions/69003766

            QUESTION

            How to properly convert dataframe from integer to numeric in R?
            Asked 2021-Aug-10 at 18:50

            I have an abundance dataframe improved as a csv with column and row headers. When imported, and running str(data) it shows each row as int. I can't use vegan's package specaccum unless the data is numeric. After converting my dataframe into numeric it is still producing the following error:

            ...

            ANSWER

            Answered 2021-Aug-10 at 18:47

            According to ?specaccum

            permutations - Number of permutations with method = "random". Usually an integer giving the number permutations, but can also be a list of control values for the permutations as returned by the function how, or a permutation matrix where each row gives the permuted indices.

            Source https://stackoverflow.com/questions/68731433

            QUESTION

            How to parse phone number as JSON
            Asked 2021-Aug-02 at 20:19

            The main stuff

            I receive an MQTT packet (which appears as an ASCII array to the buffer in format [after being printed using stringify]):

            ...

            ANSWER

            Answered 2021-Aug-02 at 20:19

            The following code will take the array and convert it back to a string via a buffer.

            Source https://stackoverflow.com/questions/68626128

            QUESTION

            Connect to MQTT Broker With Device and Browser
            Asked 2020-Dec-15 at 07:21

            I can create an MQTT broker. I can create a web client also. but there is a problem with the device. I try to connect with the IP(ws://192.168.1.240:1883) of the device. The device could not connect to the broker. Web client could connect with WebSocket.

            ...

            ANSWER

            Answered 2020-Dec-09 at 08:00

            If you want to use both MQTT over Websockets and native MQTT you will need to configure the broker to listen on 2 separate ports. You can't listen for both on the same port.

            e.g. This will accept native MQTT connections on 1883 and Websocket connections on 8883

            Source https://stackoverflow.com/questions/65212184

            QUESTION

            mqtt js get channel value at subscribe
            Asked 2020-Oct-28 at 15:22

            I am using an Aedes as the broker and MQTT.js as a client in a web application.

            At startup I connect to the broker and subscribe to some channels.

            I would like to know if there's a way to get the last previous messages in a MQTT way.

            ...

            ANSWER

            Answered 2020-Oct-28 at 15:22

            There are 2 different things here.

            1. Retained messages. This is a flag set on the message by the publisher, it tells the broker to hold on to the message and always deliver the last retained message on any given topic to a client when they first subscribe to that topic before any new messages are sent. The last retained message will always be replaced by the next message published on that topic that also has the retained flag set. You can read more about retained messages here

            2. Queued messages. If the client subscribes to a topic at greater than QOS 0 then the broker will queue up messages sent for that client while it is offline. The client needs to reconnect using the same client ID and with the cleanSession flag set to false. You can read more about persistent sessions and queued messages here

            Source https://stackoverflow.com/questions/64574070

            QUESTION

            (RESOLVED) Typescript / MQTT / Node - How to acces class member from a callback function?
            Asked 2020-Oct-16 at 12:00

            I'm making an app to manage some smart lights in my house.

            I've created a really simple Broker class.

            ...

            ANSWER

            Answered 2020-Oct-16 at 06:35

            You have to bind the this context of the class instance to a method if you'd like to pass that method as a callback. There are a couple of ways to do this in TypeScript.

            Defining the method using an arrow function:

            Source https://stackoverflow.com/questions/64382956

            QUESTION

            Build a table with total unique values for each group in Google Spreadsheet
            Asked 2020-Jul-07 at 20:07

            I am using google spreadsheets.

            Imagine there are some families of insects with the following names in column A, and their genera in column B and C imaginary names for species (they are unique FOR each genus).

            What I need is to have for EACH FAMILY (column A) the UNIQUE number of genus. I'll give the desired result after this table 1.

            NOTE: Culicidae has 31 rows

            Table 1- Original table

            ...

            ANSWER

            Answered 2020-Jul-06 at 21:09

            While it might not be achieved in a formula, utilizing the Pivot Table function will result in the second table that you are looking for, as well as being dynamic.

            In Google sheets, select your data range (Table 1) -> Click on the Data -> Select Pivot Table. From there confirm that the data range is correct and that New sheet is selected. Click create and you should be moved to the new sheet with the Pivot table editor pane open.

            To get the desired output as Table 2 add Family to Rows and Genera to Values. By default Genera will be summarized by COUNTA; in order to get the UNIQUE Count all you need to do is change COUNTA to COUNTUNIQUE.

            This Table will update automatically to any changes made within the original range, however make sure that if you add/remove any new rows that you update the Data Range within the Pivot table editor.

            Source https://stackoverflow.com/questions/62763367

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install aedes

            To install aedes, simply use npm:.

            Support

            Want to contribute? Check our list of [features/bugs](https://github.com/moscajs/aedes/projects/1).
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • npm

            npm i aedes

          • CLONE
          • HTTPS

            https://github.com/moscajs/aedes.git

          • CLI

            gh repo clone moscajs/aedes

          • sshUrl

            git@github.com:moscajs/aedes.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Websocket Libraries

            netty

            by netty

            ws

            by websockets

            websocket

            by gorilla

            websocketd

            by joewalnes

            koel

            by koel

            Try Top Libraries by moscajs

            mosca

            by moscajsJavaScript

            ascoltatori

            by moscajsJavaScript

            aedes-cli

            by moscajsJavaScript

            aedes-stats

            by moscajsJavaScript

            aedes-persistence-redis

            by moscajsJavaScript