Update neopixel.js
This commit is contained in:
parent
60e7eb9618
commit
a1fe2e5f37
@ -311,7 +311,12 @@ function bin_to_json(bin) {
|
||||
|
||||
let socket = undefined;
|
||||
function new_websocket() {
|
||||
socket = new WebSocket("ws://localhost:9002");
|
||||
if (location.hostname == "") {
|
||||
socket = new WebSocket("ws://localhost:9002");
|
||||
} else {
|
||||
socket = new WebSocket(`ws://${location.hostname}:9002`);
|
||||
}
|
||||
|
||||
socket.binaryType = "arraybuffer";
|
||||
|
||||
socket.onopen = function(e) {
|
||||
@ -347,4 +352,4 @@ function new_websocket() {
|
||||
};
|
||||
}
|
||||
|
||||
new_websocket();
|
||||
new_websocket();
|
||||
|
Loading…
Reference in New Issue
Block a user