NodeJS OSC接收并分发到本地网络

时间:2015-07-18 10:55:11

标签: node.js sockets osc

您好我有这个项目,包括从OSC格式的远程计算机接收实时数据,我希望能够将OSC数据传送或分发到同一网络中登录的其他计算机。

我正在寻找NodeJS,Express,Socket.io和OSC.js;然而,我不确定这应该如何看待通信结构。如果我没有误解一些服务器概念,我需要实现一个NodeJS服务器,它将接收它并通过socket.io转发到本地网络,我不确定,我是否通过looging到服务器或者获取此数据广播OSC数据的其他一些地址?

由于

ķ。

1 个答案:

答案 0 :(得分:0)

To send and receive data from an OSC server you would need to use some library as far as i know. I'm currently working with an OSC server and that was the only way i found to send so far.

Yes, you'll need to use a Node.js server. I use node-osc library to host it and receive the messages, showing them on a webpage with some tricks.

To send the values you can search for libraries, but i know 3 ways:

  • Arduino - there's an easy-to-use library. Usefull if you want to put some arduino board anywhere and send it through the internet.
  • node-osc - the same library you use to host you can use to send messages to the server, all you have to do is write another .js file and run it in another terminal instance and voilá.
  • Processing - processing is an IDE for visual stuff, not very usefull here aparently

I have a code on github here: https://github.com/georgerappel/WebServer-Node-OSC

I wrote some instructions on how to use there. The received messages will appear on console, you can see the code to understand basically what happens.

I don't know exactly how to send the message to everyone connected, it's a bit more complicated.