relay#
optionoav-p5?oav_relay=a ws:// or wss:// address
The address of the relay that phones and link rooms talk through: a WebSocket URL.
The 📱 button shows a QR code that sends a phone to the remote page, and the phone's MIDI tab plays your sketch through this relay. link rooms use it too. The default is the project's public relay. To keep your traffic on your own machine, run the relay from a checkout of the repository with node packages/relay/server.js and point relay at ws://localhost:7458/relay.
- Type
String (URL)- Values
a ws:// or wss:// address- default
wss://remote.cheyuwu.com/relay
Used as given.
Notes
- Nothing connects to it at load. It is used when you open the 📱 card (
OAVp5.phone()) or setlink. - Set it before oav-p5 loads.
window.OAV_P5 = { relay: … };above the loader line wins, then?oav_relay=…on the page address, then?relay=…on the script's own URL. Values inwindow.OAV_P5are turned into text, so write'off', notfalse. On OpenProcessing the page address takes?sketch_oav_relay=…(the project's README says OpenProcessing forwards it to the sketch).
Examples
window.OAV_P5 = { relay: 'ws://localhost:7458/relay' };
function setup() {
createCanvas(400, 300);
}
function draw() {
background(20);
fill(255);
text('relay: ' + OAVp5.options.relay, 20, 30); // used when you open 📱 or set link
}Related
roomThe name of the room phones join to play this page: by default one made up per browser.remoteThe address of the remote page that the 📱 QR code opens on a phone.linkJoins a room: oav-p5 pages with the same room hear what each other's programs play, over the relay. A room name, or empty for none.OAVp5.phone()Shows the 📱 card: a QR code that sends a phone to the remote page, whose MIDI tab then plays this sketch. Returns the room name.