nginx - SSL/TLS with Eclipse Paho JavaScript Client -


i've got javascript-based webapp includes eclipse paho client.

the webapp stored , executed on nginx webserver. on same server webserver installed, mqtt broker mosquitto running. i've defined port 8884 listener port secured connections.

running mosquitto_sub (simple c client) --cafile , -p 8884 works fine!

now want secure webapp using ssl passing mqttoptions = { usessl: true } in mqtt client implementation.

i can see app trying establish connection wss://ip instead of ws://ip. server responds connection refused totally clear because did not configure on webserver not have clue how manage this. wss connection 'mapped' https or something? need websocket proxy in nginx? in advance help.

you can not use same port raw mqtt , mqtt on websockets mosquitto, need create 2 separate listeners.

the fact can connect mosquitto_sub implies have set listener raw mqtt.

e.g.

listener 8883  listener 8884 protocol websockets 

this create native mqtt listener on 8883 , mqtt on websockets on port 8884


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -