Skip to content

Websocket Server Plugin

Andreas Dzialocha edited this page Jan 12, 2017 · 7 revisions

Basic setup

A default WebSocket server instance listening on ws://localhost:8080.

const osc = new OSC({ plugin: new OSC.WebsocketServerPlugin() })
osc.open() // start server on port 8080

Options

The options can be passed on inside the constructor or open method (see example below).

{
  host: 'localhost',    // @param {string} Hostname of WebSocket server
  port: 8080            // @param {number} Port of WebSocket server
}

Example

const osc = new OSC({ plugin: new OSC.WebsocketServerPlugin() })
osc.open({ port: 9912 })

Further reading

  • Example: How to create an OSC WebSocket server with osc-js.
  • Documentation: Read about the WebsocketServerPlugin class here.