mqttpress
MQTTPRESS is another Serverless Architecture using MQTT Broker.
+--------+
| MQTT |
+--------+
| | |
| | +--------------------------------------+
| | |
| +------------------+ |
| | |
+---------------+ +-------------------+ +------------------+
| Server Page | | Client Page (1) | | Client Page (2) |
+---------------+ +-------------------+ +------------------+
emulates this!
+---------------+ +---------------+
| Client Page |------Req----->| Server Page |
| (1) |<-----Res------| |
+---------------+ | |
| |
+---------------+ | |
| Client Page |------Req----->| |
| (2) |<-----Res------| |
+---------------+ +---------------+
Requirements
- node.js (>= 6)
- mqtt broker (on either your server or cloud like NIFTY Cloud or CloudMQTT)
Demo
- Open Server Page
- Click "Client Page" button to open Client page corresponding to the Server Page.
- Check console of both pages and click "Request" button.
How to use
- MQTT on Docker
% docker run -d -p 1883:1883 -p 9001:9001 --name=mosquitto sourceperl/mosquitto
- Server Side
const mqttpress = ;const config = ;const debug = "server"; const app = ; app; app; app; app; app;
- Client Side
const mqttpress = ;const config = ;const debug = "client"; const app = ;app; app;
TODO
- supporting multiple server response
License
Apache License Version 2