Open supsup opened 10 years ago
Agreed! I'm trying this now...I'm getting "Client connected" from the gl_server, so that part works. Upon further investigation I see that the sockets used by gl_server may see the initial handshake, but won't be able to do the special websockets stuff without a supporting library.
Javascript:
var ws = new WebSocket("ws://localhost:7890");
ws.onopen = function () {
var packet = new Uint8Array([ 0,0,0,9, 255,0,0, 0,255,0, 0,0,255 ]);
ws.send(packet.buffer);
};
Actually, I got this working with the help of websockify! It does exactly what's missing: acts as a websocket server for the browser, but sends the traffic to the standard socket the gl_server expects.
/path/to/websockify> ./websockify.py 7890 localhost:7891
/path/to/openpixelcontrol> bin/gl_server -l layouts/mylayout.json -p 7891
Two gotchas:
['binary', 'base64']
. Fine for gl_server, but fadecandy's server (which I'm using in "production") can only handle ['fcserver']
.cc @scanlime
Is this possible? It would make debugging/making front end webpage stuff a lot easier.