From 579506e4c5bb3f5573c85e842e4a007326e220d9 Mon Sep 17 00:00:00 2001 From: rc Date: Sat, 5 Mar 2022 15:31:22 +0100 Subject: [PATCH] Fix port --- server.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/server.js b/server.js index 1468896..f2ec90d 100644 --- a/server.js +++ b/server.js @@ -1,4 +1,4 @@ -cconsonst express = require('express') +const express = require('express') const http = require('http') const WebSocket = require('ws') const osc = require('osc') @@ -30,7 +30,7 @@ const include_files = [ const app = express(); const server = http.Server(app); -const DEBUG = false +const DEBUG = true // Odprti serijski OSC link let scon = null @@ -62,7 +62,7 @@ function openSerial() { scon.on('message', msg => { // Debug incoming osc if (DEBUG) { - //console.log('osc msg', msg) + console.log('osc msg', msg) } sendAll(msg, null, null, osclients) @@ -110,15 +110,17 @@ const wss = new WebSocket.Server({ server }) // Relay multicast to websockets // @TODO still sends to supercollider? Do we need two sockets? -var dgram = require('dgram'); -var sss = dgram.createSocket('udp4'); -sss.on('listening', () => { - sss.addMembership('224.0.1.9'); -}) -sss.bind(6696, '224.0.1.9'); +//var dgram = require('dgram'); +//var sss = dgram.createSocket('udp4'); +//sss.on('listening', () => { +// sss.addMembership('224.0.1.9'); +//}) +//sss.bind(57120); const scudp = new osc.UDPPort({ - socket: sss + //socket: sss + remotePort: 57121, + localPort: 57100 }) scudp.on('open', () => { @@ -206,6 +208,7 @@ const sendAll = (msg, info, oscWS, osclients) => { }) if (scudp) { + console.log("SENDING UDP", msg) scudp.send(msg) } }