I want to open a TCP/IP connection with a Zebra printer to send ZPL commands to print. I can do this with NodeJS but no with web sockets.
NodeJS
var s = require('net').Socket();
s.connect(9100, '192.168.0.99');
s.write(zpl_commands);
but can’t send commands on websocket, I don’t want to make a intermediary server with NodeJS that prints. Any idea if I can achieve this? I already try making a chrome plugin and didn’t work.
My websocket code
const socket = new WebSocket('ws://192.168.0.99:9100');
socket.send(message);
I need to work with Chrome, because I connect a weight machine with a serial port. It’s a possible solution to connect the printer into the computer via cable (but I would like via wifi, so I can print from several terminals)
Note: if put in my browser ws://… I can connect to the printer ‘printServer’
Note2: The printer is a Zebra ZD420