...
importudpfrom'dgram';// example client used to proxy Art-Net packetsconstclient=udp.createSocket('udp4');
...
RFXArtNetWSProxyServer(serverOrPort,functiononClient(socket){// write example// create an RFXArtNetPacket with 3 channels and send over the WebSocketconstpacketWS=newRFXArtNetPacket(3);socket.write(getWebSocketFrame(packetWS));},functiononPacket(packet){// read and proxy Art-Net packet over UDP exampleclient.send(packet,6454,'localhost');});
...
Use
constpacket=newRFXArtNetPacket(512);// inspect packetconsole.log(packet.hex());// inspect data channelsconsole.log(packet.channels);packet.setUniverse(1);packet.setSequence(0);// inspect Art-Net bufferconsole.log(packet.buffer);
...
// get a WebSocket frame to send directlysocket.write(getWebSocketFrame(packet));// or send over UDP as a normal Art-Net packetclient.send(packet,6454,'...host..or..ip');