Routes OSC, MIDI, websocket messages to the clients (nodejs and Python) from https://github.com/colinbdclark/osc.js-examples/tree/master/udp-browser
This example opens a Web Socket in a web page that communicates with a Node.js server. The server is responsible for relaying OSC messages bidirectionally between the web page and set of example Python scripts.
From the command line:
- Run
npm install
- In the
web
folder, runbower install
- Use pip to install pyosc:
sudo pip install pyosc --pre
** On Mac OS X, pip can be easily installed using the commandsudo easy_install pip
. - Use pip to install colorama
sudo pip install colorama
- In the
udp-browser
folder, start the Node.js server:node .
- In
web
folder, open index.html in a web browser; a log message will be printed to the terminal when you have connected. - To send an OSC message via UDP to the browser, run
python testSend.py
in a new terminal window; an OSC message should appear in the web browser window. - To send an OSC message from the browser to the UDP socket, run
python testReceive.py
. This will start a Python-based UDP OSC server. Then in the browser, click the 'Send OSC message' button. An OSC message should appear in the terminal window where you ran testReceive.py.
- python -m SimpleHTTPServer 8000
- Open in your browser: http://localhost:8000/