GithubHelp home page GithubHelp logo

ssl socket support about emqx HOT 5 CLOSED

emqx avatar emqx commented on May 14, 2024
ssl socket support

from emqx.

Comments (5)

emqplus avatar emqplus commented on May 14, 2024

upgrade deps/esockd to 0.2.0 to support ssl socket.

etc/app.config:

        {'mqtts', 8883, [
            {max_clients, 1024},
            {acceptor_pool, 4},
            %{cacertfile, "etc/ssl/cacert.pem"},
            {ssl, [{certfile, "etc/ssl.crt"},
                   {keyfile,  "etc/ssl.key"}]}
        ]},

from emqx.

Ethanjfobrien avatar Ethanjfobrien commented on May 14, 2024

How do you set up the config files to support a socket connection to the broker?
I'm trying to test using wscat -c ws://localhost:8083/mqtt but I get

error: Error: unexpected server response (400)

and the broker console output is:

17:38:32.386 [info] Websocket Connection from: 127.0.0.1
17:38:32.386 [error] WebSocket with error Protocol: undefined

Any help you can provide with this would be hugely appreciated!

from emqx.

emqplus avatar emqplus commented on May 14, 2024

@Ethanjfobrien, WebSocket should have 'Sec-WebSocket-Protocol' Header with value that start with 'mqtt'.

from emqx.

Ethanjfobrien avatar Ethanjfobrien commented on May 14, 2024

Thanks very much,
I got it working using mqtt.js:

mqtt pub -t 'hello' -l 'ws' -h 'localhost' -p '' -m 'hello' -v

wscat doesn't support the mqtt socket protocol

from emqx.

emqplus avatar emqplus commented on May 14, 2024

I use mqtt.js too:)

在 2015年6月19日,下午6:40,Ethan [email protected] 写道:

Thanks very much,
I got it working using mqtt.js:

mqtt pub -t 'hello' -l 'ws' -h 'localhost' -p '' -m 'hello' -v
wscat doesn't support the mqtt socket protocol


Reply to this email directly or view it on GitHub #48 (comment).

from emqx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.