Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCP Support #140

Open
boneskull opened this issue Feb 17, 2018 · 2 comments
Open

TCP Support #140

boneskull opened this issue Feb 17, 2018 · 2 comments

Comments

@boneskull
Copy link

Related to #88 and maybe other issues.

@icraggs Mentions the client should also support TCP sockets in addition to WebSockets.

This is "less important" than #139.

@ameinhardt
Copy link

my pull request #158 supports tcp/tls (for chrome app). I this issue is about tcp for node? Maybe that would result in one paho.js build for web, another for node.js?

@faisalbudiman
Copy link

faisalbudiman commented Mar 8, 2019

i want to connecting to tcp://myurl:1884
but console show an error
mqttws31.js:979 Uncaught DOMException: Failed to construct 'WebSocket': The URL 'ws://[tcp://mchat.mindwave.my]:1884/mqtt' is invalid. at ClientImpl.Paho.MQTT.ClientImpl._doConnect (http://localhost/chatsapp/Website/Client/chatweb/assets/js/mqttws31.js:979:18) at ClientImpl.Paho.MQTT.ClientImpl.connect (http://localhost/chatsapp/Website/Client/chatweb/assets/js/mqttws31.js:849:9) at Client.connect (http://localhost/chatsapp/Website/Client/chatweb/assets/js/mqttws31.js:1799:11) at http://localhost/chatsapp/Website/Client/chatweb/assets/js/app.js:303:10

this is my code for connecting

function MQTTconnect() { var token; var uname = "mindwave"; var pwd = "mindwave"; $.ajax({ url : "app/controller/getSession.php", success : function(session){ var temp = session.split("#"); token = temp[0]; } }) setTimeout(function(){ console.log("connecting to "+ host +" "+ port); mqtt = new Paho.MQTT.Client(host,port,token); var options = { timeout: 3, onSuccess: onConnect, onFailure: onFailure, userName : uname, password : pwd }; mqtt.onConnectionLost = onConnectionLost; mqtt.onMessageArrived = onMessageArrived; mqtt.onConnected = onConnected; mqtt.connect(options); //connect $("#status").val("Connecting..."); },3000); return false; }
anyone can help me please ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants