Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/khanguslee/mqtt-vs-http
An investigation into MQTT and HTTP
https://github.com/khanguslee/mqtt-vs-http
http iot mqtt
Last synced: about 1 month ago
JSON representation
An investigation into MQTT and HTTP
- Host: GitHub
- URL: https://github.com/khanguslee/mqtt-vs-http
- Owner: khanguslee
- Created: 2019-02-10T04:38:53.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-10T07:32:38.000Z (almost 6 years ago)
- Last Synced: 2024-10-20T12:56:49.171Z (3 months ago)
- Topics: http, iot, mqtt
- Language: JavaScript
- Size: 42 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MQTT-vs-HTTP
An investigation into MQTT and HTTP. As a project to learn MQTT, this repository aims to investigate whether the MQTT protocol is faster than using HTTP. To do this, we will send the same data to a central server and time how long this trip takes for both protocols.
# HTTP
## Getting started with HTTP
In the HTTP folder, make sure you download all dependencies using `npm install`. You will need to run the server and client in two different terminal sessions.
To run the server:
```bash
npm start
```To run the client:
```bash
node client.js [--number NUMBER]
```where NUMBER is the number of times you would like to send an HTTP request to the server.
# MQTT
## Getting started with MQTT
You will first need to download an MQTT broker which acts as a central server that routes data, sent by publishers, to subscribers of a specific topic.
Download the [mosquitto broker](https://mosquitto.org/download/) to run locally.
Download node libraries by running `npm install` in the MQTT folder.
To run the program:
```bash
node app.js [--number NUMBER]
```where NUMBER is the number of times you would like to publish to the topic.