A
A
akdes2017-07-26 13:18:40
Node.js
akdes, 2017-07-26 13:18:40

Through unix socket I receive data in Buffer HEX... why?

Hello.

From a developer I don't know, there is a software that sends data over a socket.
using Nodejs I join and read the data:

const client = net.createConnection('/tmp/mysocket.sock');

client.on('data', (data) => {
  console.log(data);
});

When I do this I get a message:
Buffer 04 00 10 00 00...


It was tested on a third-party software, and they get normal, readable answers there.
Please tell me what am I doing wrong?

through
nc -U /tmp/mysocket.sock

I get generally symbolic (hieroglyphs) answers

Thank you

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2017-07-26
@akdes

That's the way it should be. data.toString(); https://nodejs.org/api/buffer.html#buffer_buf_tost...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question