This tutorial shows how JavaScript application can communicate over the web with an AMQP server via Kaazing WebSocket Gateway using Kaazing JavaScript WebSocket Client library. The application publishes text messages to the server and listens to the messages from the server over WebSocket.
- Node.js version 4.4 and higher
- NPM v 3.9.5 and higher
To update NPM to the latest version:
sudo npm install npm -g
- In a terminal, navigate to the folder for a tutorial, such as
javascript.client.tutorials/amqp. - Enter
npm installto build the tutorial. - Enter
node server.jsto run the included Node.js server component (server.js). - In a browser, open the URL
http://localhost:3000/.
Note: To test basic authentication for WebSocket connection in demo app use URL - wss://sandbox.kaazing.net/amqp091-auth for location.
Checklist how to create Kaazing JavaScript WebSocket AMQP application from scratch, to be able to send and receive messages over WebSocket can be found here.
API Documentation for Kaazing JavaScript WebSocket AMQP Client library is available: