/osc4ws

Command line node.js application for bidirectional OSC over WebSocket based on https://github.com/pandrr/osc2ws.

Primary LanguageJavaScriptMIT LicenseMIT

osc4ws

OSC to WebSocket bidirectional peer to peer proxy based on osc2ws. Advertises as a _osc.udp. service over ZeroConf for one click set-up with ZeroConf/Bonjour compatible clients.

Sadly, browsers can not receive OSC data. This little tool receives OSC messages and serves them via WebSocket technology using the reliable websockets/ws library. You can then use a browser's websocket client to connect to it and receive the data. Use the same socket to send data back to the OSC client.

installation

Install node.js for your operating system.
Download or clone the repo into a folder.
Open a terminal in the osc4ws directory and type:

npm i

start

node src/main.js

After starting up, it should prompt you to define a port number for the WebSocket server and then a port number for the OSC connection. Then hopefully something like this will display

👾  ▶︎ Enter WEBSOCKET port (7000-12000) or press return for default port:
🎛 Hello:  ▶︎ Enter listen OSC port (7000-12000) or press return for default port:
🎛 Thankyou:  ▶︎ Enter remote OSC IP address and port (eg. 192.155.0.53:9090) or press return:172.20.10.4:9005
Ready for OSC over UDP.
Send to remote: 172.20.10.4:9005
Listen on: 172.20.10.2:9005
Websocket connected on port 8005
Got OSC data from: 172.20.10.4 on port 9004

Now connect your websocket to ws://localhost:8005
Send OSC data from a client or device to your local listen IP address and port
eg : 172.20.10.2:9005

This video tutorial shows the whole process for the original osc2ws version sending OSC into Cables.gl

Test

Here is a test patch using Cables.GL. You'll need to open in the Cables editor to configure. https://cables.gl/p/wElA7W