1

I want to use node.js to read and parse raw data that is send over TCP coming from a server that is continuously sending updated data every second.

i tried websocket first, but my embedded server does not provide a websocket handshake.

var WebSocket = require('ws')
var ws = new WebSocket("ws://1.100.0.250:9396");
ws.on('open', function open() {
ws.send('{abc123}');
});

ws.on('message', function incoming(data) {
console.log(data);
});
1
  • What have you tried so far? Post some code that you've tried, and let us know what's not working. Commented Sep 27, 2018 at 9:24

1 Answer 1

1

Websockets are not plain TCP sockets. If your server uses the latter, use net.connect().

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.