├── src ├── defaults.ts ├── globals.d.ts ├── browser.ts ├── Client.test.ts ├── index.ts ├── Channel.ts ├── ReconnectingWebSocket.ts ├── Client.ts └── Server.ts ├── typedoc.json ├── .gitignore ├── media ├── internals.png ├── osc-apps.png ├── osc-apps.excalidraw ├── osc-apps.svg └── internals.excalidraw ├── tslint.json ├── jest.config.js ├── tsconfig.json ├── webpack.dev.js ├── webpack.prod.js ├── bin └── browserglue.js ├── .github └── workflows │ ├── package.yml │ └── main.yml ├── webpack.common.js ├── package.json ├── devserver.js ├── dist └── index.html ├── CODE_OF_CONDUCT.md ├── README.md ├── .eslintrc.js └── LICENSE.txt /src/defaults.ts: -------------------------------------------------------------------------------- 1 | const DEFAULT_PORT = 45678; 2 | 3 | export { DEFAULT_PORT }; 4 | -------------------------------------------------------------------------------- /typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "entryPoints": ["src/index.ts"], 3 | "out": "docs" 4 | } 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | /dist/*.js* 3 | /docs/ 4 | .vscode/ 5 | .eslintcache 6 | -------------------------------------------------------------------------------- /media/internals.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munshkr/browserglue/HEAD/media/internals.png -------------------------------------------------------------------------------- /media/osc-apps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munshkr/browserglue/HEAD/media/osc-apps.png -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["tslint:recommended", "tslint-config-prettier"] 3 | } 4 | -------------------------------------------------------------------------------- /src/globals.d.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-underscore-dangle */ 2 | /* eslint-disable @typescript-eslint/naming-convention */ 3 | declare let __VERSION__: string; 4 | -------------------------------------------------------------------------------- /src/browser.ts: -------------------------------------------------------------------------------- 1 | import Client from "./Client"; 2 | import Channel from "./Channel"; 3 | import { Message, Bundle } from "osc-js"; 4 | 5 | const version = __VERSION__; 6 | 7 | export { Client, Channel, Message, Bundle, version }; 8 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "roots": [ 3 | "/src" 4 | ], 5 | "testMatch": [ 6 | "**/__tests__/**/*.+(ts|tsx|js)", 7 | "**/?(*.)+(spec|test).+(ts|tsx|js)" 8 | ], 9 | "transform": { 10 | "^.+\\.(ts|tsx)$": "ts-jest" 11 | }, 12 | } 13 | -------------------------------------------------------------------------------- /src/Client.test.ts: -------------------------------------------------------------------------------- 1 | import Client from "./Client"; 2 | // import WebSocket from 'isomorphic-ws'; 3 | 4 | test("constructor", () => { 5 | const client = new Client(); 6 | expect(client.url).toBe("ws://localhost:8000"); 7 | // const ws = new WebSocket('ws://localhost:8000'); 8 | }); 9 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowJs": true, 4 | "target": "es5", 5 | "module": "es6", 6 | "moduleResolution": "node", 7 | "esModuleInterop": true, 8 | "outDir": "./lib" 9 | }, 10 | "include": [ 11 | "./.eslintrc.js", 12 | "./*", 13 | "./src/**/*" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/naming-convention */ 2 | /* eslint-disable @typescript-eslint/no-unsafe-assignment */ 3 | import Client from "./Client"; 4 | import Channel from "./Channel"; 5 | import Server from "./Server"; 6 | import * as defaults from "./defaults"; 7 | import { Message, Bundle } from "osc-js"; 8 | 9 | const version = __VERSION__; 10 | 11 | export { Client, Channel, Server, Message, Bundle, version, defaults }; 12 | -------------------------------------------------------------------------------- /webpack.dev.js: -------------------------------------------------------------------------------- 1 | const { merge } = require('webpack-merge'); 2 | const [commonNodeConfig, commonBrowserConfig] = require('./webpack.common.js'); 3 | 4 | const developmentConfig = { 5 | mode: 'development', 6 | devtool: 'inline-source-map', 7 | } 8 | 9 | const nodeConfig = merge(commonNodeConfig, developmentConfig); 10 | const browserConfig = merge(commonBrowserConfig, developmentConfig); 11 | 12 | module.exports = [nodeConfig, browserConfig]; 13 | -------------------------------------------------------------------------------- /webpack.prod.js: -------------------------------------------------------------------------------- 1 | const process = require('process'); 2 | const { merge } = require('webpack-merge'); 3 | const [commonNodeConfig, commonBrowserConfig] = require('./webpack.common.js'); 4 | 5 | const productionConfig = { 6 | mode: 'production', 7 | devtool: 'source-map', 8 | } 9 | 10 | const nodeConfig = merge(commonNodeConfig, productionConfig); 11 | const browserConfig = merge(commonBrowserConfig, productionConfig); 12 | 13 | module.exports = [nodeConfig, browserConfig]; 14 | -------------------------------------------------------------------------------- /bin/browserglue.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | const program = require("commander"); 3 | const packageInfo = require("../package.json"); 4 | const { Server, defaults } = require("../dist/browserglue.node"); 5 | const debug = require("debug")("browserglue"); 6 | 7 | const { DEFAULT_PORT } = defaults; 8 | 9 | program 10 | .version(packageInfo.version) 11 | .option("-H, --host ", "WebSockets binding host", "localhost") 12 | .option("-P, --port ", "WebSockets port number", DEFAULT_PORT) 13 | .parse(process.argv); 14 | 15 | const options = program.opts(); 16 | 17 | debug("Create server and connect to %s:%d", options.host, options.port); 18 | const server = new Server({ 19 | host: options.host, 20 | port: options.port, 21 | }); 22 | 23 | server.on("listening", () => { 24 | process.stderr.write(`Server listening on ${server.host}:${server.port}\n`); 25 | }); 26 | 27 | debug("Start server"); 28 | server.start(); 29 | -------------------------------------------------------------------------------- /.github/workflows/package.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: CD 4 | 5 | on: 6 | push: 7 | tags: 8 | - 'v*' 9 | 10 | jobs: 11 | build-and-release: 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v2 16 | 17 | - name: Setup Node.js environment 18 | uses: actions/setup-node@v2.1.5 19 | 20 | - name: Install dependencies 21 | run: yarn install 22 | 23 | - name: Build library 24 | run: yarn build 25 | 26 | - name: Package binaries 27 | run: npx pkg . 28 | 29 | - name: Create Release 30 | uses: softprops/action-gh-release@v1 31 | with: 32 | files: | 33 | browserglue-linux 34 | browserglue-macos 35 | browserglue-win.exe 36 | env: 37 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 38 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: CI 4 | 5 | # Controls when the action will run. 6 | on: 7 | # Triggers the workflow on push or pull request events but only for the main branch 8 | push: 9 | branches: [ main ] 10 | pull_request: 11 | branches: [ main ] 12 | 13 | # Allows you to run this workflow manually from the Actions tab 14 | workflow_dispatch: 15 | 16 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 17 | jobs: 18 | # This workflow contains a single job called "build" 19 | build: 20 | # The type of runner that the job will run on 21 | runs-on: ubuntu-latest 22 | 23 | # Steps represent a sequence of tasks that will be executed as part of the job 24 | steps: 25 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 26 | - uses: actions/checkout@v2 27 | 28 | - name: Setup Node.js environment 29 | uses: actions/setup-node@v2.1.5 30 | 31 | - name: Install dependencies 32 | run: yarn install 33 | 34 | - name: Run tests 35 | run: yarn test 36 | -------------------------------------------------------------------------------- /webpack.common.js: -------------------------------------------------------------------------------- 1 | const path = require("path"); 2 | const webpack = require("webpack"); 3 | const nodeExternals = require('webpack-node-externals'); 4 | 5 | const plugins = [ 6 | new webpack.DefinePlugin({ 7 | __VERSION__: JSON.stringify(require("./package.json").version) 8 | }) 9 | ] 10 | 11 | const nodeConfig = { 12 | target: "node", 13 | entry: "./src/index.ts", 14 | module: { 15 | rules: [ 16 | { 17 | test: /\.ts$/, 18 | use: "ts-loader", 19 | exclude: /node_modules/, 20 | }, 21 | ], 22 | }, 23 | resolve: { 24 | extensions: [".ts", ".js"], 25 | }, 26 | externals: [nodeExternals()], 27 | plugins, 28 | output: { 29 | path: path.resolve(__dirname, "dist"), 30 | filename: "browserglue.node.js", 31 | library: "browserglue", 32 | libraryTarget: "umd", 33 | publicPath: "/", 34 | }, 35 | }; 36 | 37 | const browserConfig = { 38 | target: "web", 39 | mode: "production", 40 | entry: "./src/browser.ts", 41 | module: { 42 | rules: [ 43 | { 44 | test: /\.ts$/, 45 | use: "ts-loader", 46 | exclude: /node_modules/, 47 | }, 48 | ], 49 | }, 50 | resolve: { 51 | extensions: [".ts", ".js"], 52 | fallback: { 53 | dgram: false, // do not include a polyfill for dgram 54 | }, 55 | }, 56 | plugins, 57 | output: { 58 | path: path.resolve(__dirname, "dist"), 59 | filename: "browserglue.js", 60 | library: "browserglue", 61 | libraryTarget: "umd", 62 | publicPath: "/", 63 | }, 64 | }; 65 | 66 | module.exports = [nodeConfig, browserConfig]; 67 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "browserglue", 3 | "version": "0.2.2", 4 | "author": "Damián Silvani ", 5 | "license": "AGPL-3.0-or-later", 6 | "description": "Exposes TCP/UDP connections to the browser through WebSockets", 7 | "repository": "https://github.com/munshkr/browserglue", 8 | "main": "dist/browserglue.node.js", 9 | "browser": "dist/browserglue.js", 10 | "files": [ 11 | "bin/*", 12 | "dist/*" 13 | ], 14 | "scripts": { 15 | "dev": "node devserver.js", 16 | "build": "webpack --config webpack.prod.js", 17 | "lint": "eslint --fix", 18 | "test": "exit 0", 19 | "docs": "typedoc --media media/" 20 | }, 21 | "bin": { 22 | "browserglue": "./bin/browserglue.js" 23 | }, 24 | "devDependencies": { 25 | "@types/debug": "^4.1.5", 26 | "@types/jest": "^26.0.20", 27 | "@types/node": "^14.14.27", 28 | "@types/ws": "^7.4.0", 29 | "@typescript-eslint/eslint-plugin": "^4.15.2", 30 | "@typescript-eslint/parser": "^4.15.2", 31 | "eslint": "^7.20.0", 32 | "eslint-config-prettier": "^8.1.0", 33 | "eslint-plugin-jsdoc": "^32.2.0", 34 | "eslint-plugin-prefer-arrow": "^1.2.3", 35 | "eslint-plugin-prettier": "^3.3.1", 36 | "jest": "^26.6.3", 37 | "prettier": "^2.2.1", 38 | "ts-jest": "^26.5.3", 39 | "ts-loader": "^8.0.17", 40 | "typedoc": "^0.20.30", 41 | "typescript": "^4.1.5", 42 | "webpack": "^5.24.2", 43 | "webpack-cli": "^4.5.0", 44 | "webpack-dev-middleware": "^4.1.0", 45 | "webpack-merge": "^5.7.3", 46 | "webpack-node-externals": "^2.5.2" 47 | }, 48 | "dependencies": { 49 | "body-parser": "^1.19.0", 50 | "commander": "^7.0.0", 51 | "cors": "^2.8.5", 52 | "debug": "^4.3.1", 53 | "events": "^3.2.0", 54 | "express": "^4.17.1", 55 | "isomorphic-ws": "^4.0.1", 56 | "json-rpc-2.0": "^0.2.15", 57 | "osc-js": "^2.3.0", 58 | "ws": "^7.4.3" 59 | }, 60 | "optionalDependencies": { 61 | "bufferutil": "^4.0.3", 62 | "utf-8-validate": "^5.0.4" 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /devserver.js: -------------------------------------------------------------------------------- 1 | const { spawn } = require('child_process'); 2 | const express = require('express'); 3 | const webpack = require('webpack'); 4 | const middleware = require('webpack-dev-middleware'); 5 | 6 | const app = express(); 7 | const [nodeConfig, browserConfig] = require('./webpack.prod.js'); 8 | 9 | /** 10 | * Node 11 | */ 12 | const nodeCompiler = webpack(nodeConfig); 13 | 14 | // Start middleware. Use writeToDisk because bin/browserglue.js requires the bundle on dist/ 15 | middleware(nodeCompiler, { writeToDisk: true }); 16 | 17 | const spawnBrowserglueBinary = () => { 18 | console.log('* Spawn Browserglue child process') 19 | const bin = spawn('./bin/browserglue.js'); 20 | 21 | bin.stdout.on('data', (data) => { 22 | process.stdout.write(data.toString()); 23 | }); 24 | 25 | bin.stderr.on('data', (data) => { 26 | process.stderr.write(data.toString()); 27 | }); 28 | 29 | bin.on('close', (code) => { 30 | console.log(`* Browserglue child process exited with code ${code}`); 31 | }); 32 | 33 | return bin; 34 | } 35 | 36 | let serverProcess; 37 | 38 | // Whenever compilation finishes, (re)spawn browserglue child process 39 | nodeCompiler.hooks.done.tap('RestartBrowserGlue', (stats) => { 40 | // return true to emit the output, otherwise false 41 | // console.log(stats); 42 | console.log('* Restart Browserglue server'); 43 | if (serverProcess) { 44 | serverProcess.kill(); 45 | } 46 | serverProcess = spawnBrowserglueBinary(); 47 | return true; 48 | }); 49 | 50 | /** 51 | * Browser 52 | */ 53 | const browserCompiler = webpack(browserConfig); 54 | const browserMiddleware = middleware(browserCompiler, { 55 | publicPath: browserConfig.output.publicPath, 56 | }); 57 | 58 | // Tell express to use the webpack-dev-middleware and use the webpack dev 59 | // configuration file as a base. 60 | app.use(browserMiddleware); 61 | app.use(express.static('dist')); 62 | 63 | // Serve the files on port 3000. 64 | app.listen(3000, () => { 65 | console.log('Serving files at dist/ on http://localhost:3000'); 66 | }); -------------------------------------------------------------------------------- /src/Channel.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-underscore-dangle */ 2 | import Client from "./Client"; 3 | import EventEmitter from "events"; 4 | import Debug from "debug"; 5 | import OSC from "osc-js"; 6 | 7 | const debug = Debug("browserglue").extend("channel"); 8 | 9 | interface ServerChannel { 10 | path: string; 11 | port?: number; 12 | subscribedPorts: number[]; 13 | } 14 | 15 | class Channel { 16 | readonly path: string; 17 | 18 | protected _client: Client; 19 | protected _subscribedPorts: number[]; 20 | protected _port: number; 21 | protected _open: boolean; 22 | protected _emitter: EventEmitter; 23 | 24 | constructor( 25 | client: Client, 26 | path: string, 27 | subscribedPorts: number[], 28 | port?: number 29 | ) { 30 | this.path = path; 31 | 32 | this._client = client; 33 | this._subscribedPorts = subscribedPorts; 34 | this._port = port; 35 | this._open = true; 36 | 37 | // Update attributes from server state (change event) 38 | client.on(`change:${path}`, (state: ServerChannel) => { 39 | // eslint-disable-next-line @typescript-eslint/no-shadow 40 | const { subscribedPorts, port } = state; 41 | debug( 42 | "Received change from server. Update channel %s state: %o %o", 43 | path, 44 | subscribedPorts, 45 | port 46 | ); 47 | this._subscribedPorts = subscribedPorts; 48 | this._port = port; 49 | }); 50 | 51 | // Make sure to close this channel if it was removed on server 52 | client.on(`remove-channel:${path}`, () => { 53 | this._open = false; 54 | }); 55 | } 56 | 57 | get port(): number { 58 | return this._port; 59 | } 60 | 61 | get subscribedPorts(): number[] { 62 | return this._subscribedPorts; 63 | } 64 | 65 | on(event: string, listener: (...args: any[]) => void): Channel { 66 | this._client.on(`${event}:${this.path}`, listener); 67 | return this; 68 | } 69 | 70 | // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types 71 | publish(msg: OSC.Message | OSC.Bundle): boolean { 72 | if (!this._open) return false; 73 | return this._client.publish(this.path, msg); 74 | } 75 | 76 | async bindPort(port: number): Promise { 77 | if (!this._open) return false; 78 | return this._client.bindPort(this.path, port); 79 | } 80 | 81 | async unbindPort(): Promise { 82 | if (!this._open) return false; 83 | return this._client.unbindPort(this.path); 84 | } 85 | 86 | async subscribePort(port: number): Promise { 87 | if (!this._open) return false; 88 | return await this._client.subscribePort(this.path, port); 89 | } 90 | 91 | async unsubscribePort(port: number): Promise { 92 | if (!this._open) return false; 93 | return this._client.unsubscribePort(this.path, port); 94 | } 95 | 96 | async unsubscribeAllPorts(): Promise { 97 | if (!this._open) return false; 98 | return this._client.unsubscribeAllPorts(this.path); 99 | } 100 | 101 | async remove(): Promise { 102 | if (!this._open) return false; 103 | await this._client.removeChannel(this.path); 104 | this._open = false; 105 | return true; 106 | } 107 | } 108 | 109 | export default Channel; 110 | export { Channel, ServerChannel }; 111 | -------------------------------------------------------------------------------- /dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | browserglue example 9 | 10 | 11 | 12 |

browserglue testbed

13 |

Open the Developer Tools and check the console log. You can use a browserglue client at bg 14 | (window.bg).

15 |

You can also enable debug logging messages by setting `localStorage.debug` to `browserglue*`, like this

16 | 17 | localStorage.debug = 'browserglue*' 18 | 19 |

You need to refresh the page for this setting to take effect.

20 | 21 | 22 | 88 | 89 | -------------------------------------------------------------------------------- /src/ReconnectingWebSocket.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-underscore-dangle */ 2 | import WebSocket from "isomorphic-ws"; 3 | import { EventEmitter } from "events"; 4 | 5 | interface Options { 6 | autoConnect?: boolean; 7 | reconnectTimeoutInterval?: number; 8 | binaryType?: "arraybuffer" | "blob"; 9 | } 10 | 11 | class ReconnectingWebSocket { 12 | url: string; 13 | reconnectTimeoutInterval: number; 14 | binaryType?: string; 15 | 16 | protected _ws: WebSocket; 17 | protected _emitter: EventEmitter; 18 | protected _started: boolean; 19 | protected _connected: boolean; 20 | protected _reconnectTimeout: NodeJS.Timeout; 21 | protected _isReconnecting: boolean; 22 | 23 | constructor(url: string, options?: Options) { 24 | const { 25 | autoConnect, 26 | reconnectTimeoutInterval, 27 | binaryType, 28 | }: Options = Object.assign({}, options, { 29 | autoConnect: true, 30 | reconnectTimeoutInterval: 5000, 31 | }); 32 | 33 | this.url = url; 34 | this.reconnectTimeoutInterval = reconnectTimeoutInterval; 35 | this.binaryType = binaryType; 36 | 37 | this._started = false; 38 | this._connected = false; 39 | this._emitter = new EventEmitter(); 40 | 41 | if (autoConnect) this.connect(); 42 | } 43 | 44 | get connected(): boolean { 45 | return this._connected; 46 | } 47 | 48 | connect(): ReconnectingWebSocket { 49 | if (this.connected) return this; 50 | this._started = true; 51 | this._connect(); 52 | return this; 53 | } 54 | 55 | disconnect(): ReconnectingWebSocket { 56 | this._started = false; 57 | clearTimeout(this._reconnectTimeout); 58 | this._ws.close(); 59 | return this; 60 | } 61 | 62 | on( 63 | event: string | symbol, 64 | listener: (...args: any[]) => void 65 | ): ReconnectingWebSocket { 66 | this._emitter.on(event, listener); 67 | return this; 68 | } 69 | 70 | // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types 71 | send(data: any): ReconnectingWebSocket { 72 | this._ws.send(data); 73 | return this; 74 | } 75 | 76 | protected _connect(): void { 77 | if (this._ws) this._ws.close(); 78 | 79 | this._ws = new WebSocket(this.url); 80 | const ws = this._ws; 81 | 82 | if (this.binaryType) { 83 | ws.binaryType = this.binaryType; 84 | } 85 | 86 | clearTimeout(this._reconnectTimeout); 87 | 88 | ws.onopen = (event: WebSocket.OpenEvent) => { 89 | if (!this._connected) this._emitter.emit("connect"); 90 | this._connected = true; 91 | this._isReconnecting = false; 92 | this._emitter.emit("open", event); 93 | }; 94 | 95 | ws.onclose = (event: WebSocket.CloseEvent) => { 96 | if (this._connected) this._emitter.emit("disconnect"); 97 | this._connected = false; 98 | this._isReconnecting = false; 99 | if (this._started) this._reconnect(); 100 | this._emitter.emit("close", event); 101 | }; 102 | 103 | ws.onerror = (event: WebSocket.ErrorEvent) => 104 | this._emitter.emit("error", event.error); 105 | ws.onmessage = (event: WebSocket.MessageEvent) => 106 | this._emitter.emit("message", event); 107 | } 108 | 109 | protected _reconnect(): void { 110 | // If is reconnecting so do nothing 111 | if (this._isReconnecting || this._connected || !this._started) { 112 | return; 113 | } 114 | // Set timeout 115 | this._isReconnecting = true; 116 | clearTimeout(this._reconnectTimeout); 117 | this._reconnectTimeout = setTimeout(() => { 118 | // eslint-disable-next-line no-console 119 | console.debug("[ws] Reconnecting to", this.url); 120 | this._connect(); 121 | }, this.reconnectTimeoutInterval); 122 | } 123 | } 124 | 125 | export default ReconnectingWebSocket; 126 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | munshkr@gmail.com. 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # browserglue 2 | 3 | ![status](https://github.com/munshkr/browserglue/actions/workflows/main.yml/badge.svg) 4 | 5 | > Exposes OSC connections to the browser through WebSockets. 6 | 7 | *Work in progress, design and interface may change frequently* 8 | 9 | ## Features 10 | 11 | * Send messages from local OSC applications to different channels. 12 | * Publish messages to channels and broadcast them to multiple OSC application on your machine. 13 | * Portable cross-platform executable that acts as the Server. 14 | * Server can be controlled remotely from clients (Browser or Node.js library). 15 | 16 | ## Example 17 | 18 | ### Send and receive messages (SuperCollider example) 19 | 20 | This example creates a single channel called `/sclang`, and binds it to the port 21 | 4000. It also subscribes port 57120 to forward all messages published to this 22 | channel. 23 | 24 | ```javascript 25 | const { Client, Message } = browserglue; 26 | const osc = new Client(); 27 | 28 | console.log("Add channel /sclang binded to udp:4000") 29 | osc.addChannel("/sclang", 4000).then(channel => { 30 | // Handle messages sent to port 4000 31 | channel.on("message", msg => { 32 | console.log("Received:", msg.address, msg.args); 33 | }); 34 | 35 | // Subscribe to port 57120 (default SuperCollider interpreter port) 36 | channel.subscribePort(57120); 37 | 38 | setInterval(() => { 39 | const now = new Date(); 40 | const msg = new Message("/chat", 42, now.toISOString()); 41 | channel.publish(msg); 42 | console.log("Publish:", msg.address, msg.args); 43 | }, 1000); 44 | }); 45 | ``` 46 | 47 | You can try this on SuperCollider, by running the following pieces of code: 48 | 49 | ```smalltalk 50 | s.boot; 51 | 52 | // Listen messages on port 51720 53 | ( 54 | OSCdef(\test, { |msg, time, addr, recvPort| 55 | "Received from browser: %".format([time, msg]).postln 56 | }, '/chat'); 57 | ) 58 | 59 | // Send every 2 seconds an OSC message to port 4000 60 | b = NetAddr("127.0.0.1", 4000); 61 | ( 62 | r = Routine { 63 | inf.do { |i| 64 | "Sent: /hello there! %".format(i).postln; 65 | b.sendMsg("/hello", "there!", i); 66 | 2.wait; 67 | } 68 | }.play; 69 | ) 70 | ``` 71 | 72 | ### Multiple channels 73 | 74 | ```javascript 75 | (async () => { 76 | const { Client, Message } = browserglue; 77 | window.bg = new Client(); 78 | 79 | // Subscribe to all server events 80 | bg.on('connect', (() => console.log("[connect]"))); 81 | bg.on('disconnect', (() => console.log("[disconnect]"))); 82 | bg.on('change', (msg => console.log("[change]", msg))); 83 | bg.on('add-channel', (msg => console.log("[add-channel]", msg))); 84 | bg.on('remove-channel', (msg => console.log("[remove-channel]", msg))); 85 | bg.on('bind-port', (msg => console.log("[bind-port]", msg))); 86 | bg.on('subscribe-port', (msg => console.log("[subscribe-port]", msg))); 87 | bg.on('unsubscribe-port', (msg => console.log("[unsubscribe-port]", msg))); 88 | 89 | console.log("Remove all channels first"); 90 | await bg.removeAllChannels(); 91 | 92 | console.log("Add channel /foo binded to udp:4000") 93 | const channel = await bg.addChannel("/foo", 4000); 94 | 95 | // Handle messages 96 | channel.on('message', msg => { 97 | console.log("[/foo]", msg.address, msg.args); 98 | }); 99 | 100 | // Remove channel after 3 seconds 101 | console.log("Remove channel /foo in 3 seconds..."); 102 | setTimeout(() => { 103 | console.log("Remove channel /foo"); 104 | channel.remove(); 105 | console.log("Current channels:", bg.channels); 106 | }, 3000); 107 | 108 | // Add another channel 109 | console.log("Add channel /bar binded to udp:5000"); 110 | const barChannel = await bg.addChannel("/bar", 5000); 111 | console.log("Subscribe port 5010 on /bar"); 112 | barChannel.subscribePort(5010); 113 | console.log("Subscribe port 5011 on /bar"); 114 | barChannel.subscribePort(5011); 115 | // Handle messages 116 | barChannel.on('message', msg => { 117 | console.log("[/bar]", msg.args); 118 | }); 119 | 120 | // Remove channel after 3 seconds 121 | setTimeout(() => { 122 | console.log("Unsubscribe port 5010 on channel /bar"); 123 | barChannel.unsubscribePort(5010); 124 | console.log("/bar Channel instance:", barChannel); 125 | }, 500); 126 | 127 | // List all channels 128 | console.log("Current channels:", bg.channels); 129 | 130 | setInterval(() => { 131 | const now = new Date(); 132 | const msg = new Message("/myaddress/1", 42, now.toISOString()); 133 | if (barChannel.publish(msg)) { 134 | console.log("Publish to /bar:", msg.address, msg.args); 135 | } 136 | }, 3000); 137 | })(); 138 | ``` 139 | 140 | ## Development 141 | 142 | After cloning repository, install dependencies with `yarn` or `yarn install` . 143 | 144 | You can start a development server by runnig `yarn dev`. It will watch source 145 | files for changes and restart the BrowserGlue binary script automatically. 146 | 147 | To create production bundles for the browser and Nodejs, run `yarn build` . 148 | This will generate a `dist/browserglue.js` library for browsers, and 149 | `dist/browserglue.node.js` for Nodejs. 150 | 151 | Run `yarn docs` to build documentation. 152 | 153 | ## Design 154 | 155 | ### OSC Apps Supported Use Cases 156 | 157 | ![Diagram: OSC Apps Use Cases](media/osc-apps.png) 158 | 159 | ### Internals 160 | 161 | ![Diagram: Internals](media/internals.png) 162 | 163 | ## Contributing 164 | 165 | Bug reports and pull requests are welcome on GitHub at the [issues 166 | page](https://github.com/munshkr/browserglue). This project is intended to be a 167 | safe, welcoming space for collaboration, and contributors are expected to 168 | adhere to the [Contributor Covenant](http://contributor-covenant.org) code of 169 | conduct. 170 | 171 | ## License 172 | 173 | This project is licensed under AGPL 3+. Refer to [LICENSE.txt](LICENSE.txt). 174 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | /* 3 | 👋 Hi! This file was autogenerated by tslint-to-eslint-config. 4 | https://github.com/typescript-eslint/tslint-to-eslint-config 5 | 6 | It represents the closest reasonable ESLint configuration to this 7 | project's original TSLint configuration. 8 | 9 | We recommend eventually switching this configuration to extend from 10 | the recommended rulesets in typescript-eslint. 11 | https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md 12 | 13 | Happy linting! 💖 14 | */ 15 | module.exports = { 16 | "env": { 17 | "browser": true, 18 | "node": true 19 | }, 20 | "extends": [ 21 | "plugin:@typescript-eslint/recommended", 22 | "plugin:@typescript-eslint/recommended-requiring-type-checking", 23 | "plugin:prettier/recommended", 24 | "prettier" 25 | ], 26 | "parser": "@typescript-eslint/parser", 27 | "parserOptions": { 28 | "project": "tsconfig.json", 29 | "sourceType": "module" 30 | }, 31 | "plugins": [ 32 | "eslint-plugin-jsdoc", 33 | "eslint-plugin-prefer-arrow", 34 | "@typescript-eslint" 35 | ], 36 | "rules": { 37 | "prettier/prettier": "error", 38 | "@typescript-eslint/adjacent-overload-signatures": "error", 39 | "@typescript-eslint/array-type": [ 40 | "error", 41 | { 42 | "default": "array" 43 | } 44 | ], 45 | "@typescript-eslint/ban-types": [ 46 | "error", 47 | { 48 | "types": { 49 | "Object": { 50 | "message": "Avoid using the `Object` type. Did you mean `object`?" 51 | }, 52 | "Function": { 53 | "message": "Avoid using the `Function` type. Prefer a specific function type, like `() => void`." 54 | }, 55 | "Boolean": { 56 | "message": "Avoid using the `Boolean` type. Did you mean `boolean`?" 57 | }, 58 | "Number": { 59 | "message": "Avoid using the `Number` type. Did you mean `number`?" 60 | }, 61 | "String": { 62 | "message": "Avoid using the `String` type. Did you mean `string`?" 63 | }, 64 | "Symbol": { 65 | "message": "Avoid using the `Symbol` type. Did you mean `symbol`?" 66 | } 67 | } 68 | } 69 | ], 70 | "@typescript-eslint/consistent-type-assertions": "error", 71 | "@typescript-eslint/dot-notation": "error", 72 | "@typescript-eslint/indent": "off", 73 | "@typescript-eslint/member-delimiter-style": [ 74 | "off", 75 | { 76 | "multiline": { 77 | "delimiter": "none", 78 | "requireLast": true 79 | }, 80 | "singleline": { 81 | "delimiter": "semi", 82 | "requireLast": false 83 | } 84 | } 85 | ], 86 | "@typescript-eslint/naming-convention": "error", 87 | "@typescript-eslint/no-empty-function": "error", 88 | "@typescript-eslint/no-empty-interface": "error", 89 | "@typescript-eslint/no-explicit-any": "off", 90 | "@typescript-eslint/no-misused-new": "error", 91 | "@typescript-eslint/no-namespace": "error", 92 | "@typescript-eslint/no-parameter-properties": "off", 93 | "@typescript-eslint/no-shadow": [ 94 | "error", 95 | { 96 | "hoist": "all" 97 | } 98 | ], 99 | "@typescript-eslint/no-unused-expressions": "error", 100 | "@typescript-eslint/no-use-before-define": "off", 101 | "@typescript-eslint/no-var-requires": "error", 102 | "@typescript-eslint/prefer-for-of": "error", 103 | "@typescript-eslint/prefer-function-type": "error", 104 | "@typescript-eslint/prefer-namespace-keyword": "error", 105 | "@typescript-eslint/quotes": "off", 106 | "@typescript-eslint/semi": [ 107 | "off", 108 | null 109 | ], 110 | "@typescript-eslint/triple-slash-reference": [ 111 | "error", 112 | { 113 | "path": "always", 114 | "types": "prefer-import", 115 | "lib": "always" 116 | } 117 | ], 118 | "@typescript-eslint/type-annotation-spacing": "off", 119 | "@typescript-eslint/unified-signatures": "error", 120 | "arrow-parens": [ 121 | "off", 122 | "always" 123 | ], 124 | "brace-style": [ 125 | "off", 126 | "off" 127 | ], 128 | "comma-dangle": "off", 129 | "complexity": "off", 130 | "constructor-super": "error", 131 | "eol-last": "off", 132 | "eqeqeq": [ 133 | "error", 134 | "smart" 135 | ], 136 | "guard-for-in": "error", 137 | "id-blacklist": [ 138 | "error", 139 | "any", 140 | "Number", 141 | "number", 142 | "String", 143 | "string", 144 | "Boolean", 145 | "boolean", 146 | "Undefined", 147 | "undefined" 148 | ], 149 | "id-match": "error", 150 | "jsdoc/check-alignment": "error", 151 | "jsdoc/check-indentation": "error", 152 | "jsdoc/newline-after-description": "error", 153 | "linebreak-style": "off", 154 | "max-classes-per-file": [ 155 | "error", 156 | 1 157 | ], 158 | "max-len": "off", 159 | "new-parens": "off", 160 | "newline-per-chained-call": "off", 161 | "no-bitwise": "error", 162 | "no-caller": "error", 163 | "no-cond-assign": "error", 164 | "no-console": "error", 165 | "no-debugger": "error", 166 | "no-empty": "error", 167 | "no-eval": "error", 168 | "no-extra-semi": "off", 169 | "no-fallthrough": "off", 170 | "no-invalid-this": "off", 171 | "no-irregular-whitespace": "off", 172 | "no-multiple-empty-lines": "off", 173 | "no-new-wrappers": "error", 174 | "no-throw-literal": "error", 175 | "no-trailing-spaces": "off", 176 | "no-undef-init": "error", 177 | "no-underscore-dangle": "error", 178 | "no-unsafe-finally": "error", 179 | "no-unused-labels": "error", 180 | "no-var": "error", 181 | "object-shorthand": "error", 182 | "one-var": [ 183 | "error", 184 | "never" 185 | ], 186 | "prefer-arrow/prefer-arrow-functions": "error", 187 | "prefer-const": "error", 188 | "quote-props": "off", 189 | "radix": "error", 190 | "react/jsx-curly-spacing": "off", 191 | "react/jsx-equals-spacing": "off", 192 | "react/jsx-tag-spacing": [ 193 | "off", 194 | { 195 | "afterOpening": "allow", 196 | "closingSlash": "allow" 197 | } 198 | ], 199 | "react/jsx-wrap-multilines": "off", 200 | "space-before-function-paren": "off", 201 | "space-in-parens": [ 202 | "off", 203 | "never" 204 | ], 205 | "spaced-comment": [ 206 | "error", 207 | "always", 208 | { 209 | "markers": [ 210 | "/" 211 | ] 212 | } 213 | ], 214 | "use-isnan": "error", 215 | "valid-typeof": "off" 216 | } 217 | }; 218 | -------------------------------------------------------------------------------- /src/Client.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-unsafe-assignment */ 2 | /* eslint-disable no-underscore-dangle */ 3 | /* eslint-disable @typescript-eslint/no-unsafe-call */ 4 | /* eslint-disable @typescript-eslint/no-unsafe-member-access */ 5 | /* eslint-disable @typescript-eslint/no-unsafe-return */ 6 | import { JSONRPCClient } from "json-rpc-2.0"; 7 | import { EventEmitter } from "events"; 8 | import WebSocket from "isomorphic-ws"; 9 | import ReconnectingWebSocket from "./ReconnectingWebSocket"; 10 | import Channel, { ServerChannel } from "./Channel"; 11 | import { DEFAULT_PORT } from "./defaults"; 12 | import Debug from "debug"; 13 | import OSC from "osc-js"; 14 | 15 | const debug = Debug("browserglue").extend("client"); 16 | 17 | type ServerEventWSPayload = { 18 | event: string; 19 | message: any; 20 | }; 21 | 22 | type AddChannelEventPayload = { 23 | path: string; 24 | }; 25 | 26 | type RemoveChannelEventPayload = { 27 | path: string; 28 | }; 29 | 30 | const buildRPCClient = (wsUrl: string): JSONRPCClient => { 31 | const [scheme, hostnamePort] = wsUrl.split("://"); 32 | const secure = scheme === "wss"; 33 | const httpScheme = secure ? "https" : "http"; 34 | const url = `${httpScheme}://${hostnamePort}/json-rpc`; 35 | 36 | // JSONRPCClient needs to know how to send a JSON-RPC request. 37 | // Tell it by passing a function to its constructor. The function must take a JSON-RPC request and send it. 38 | const client = new JSONRPCClient((jsonRPCRequest) => 39 | fetch(url, { 40 | method: "POST", 41 | headers: { 42 | "content-type": "application/json", 43 | }, 44 | body: JSON.stringify(jsonRPCRequest), 45 | }).then((response) => { 46 | if (response.status === 200) { 47 | // Use client.receive when you received a JSON-RPC response. 48 | return response 49 | .json() 50 | .then((jsonRPCResponse) => client.receive(jsonRPCResponse)); 51 | } else if (jsonRPCRequest.id) { 52 | return Promise.reject(new Error(response.statusText)); 53 | } 54 | }) 55 | ); 56 | 57 | return client; 58 | }; 59 | 60 | class Client { 61 | readonly url: string; 62 | 63 | protected _channels: { [path: string]: Channel }; 64 | protected _emitter: EventEmitter; 65 | protected _rpcClient: JSONRPCClient; 66 | protected _ws: ReconnectingWebSocket; 67 | protected _channelWss: { [path: string]: ReconnectingWebSocket }; 68 | 69 | constructor(url = `ws://localhost:${DEFAULT_PORT}`) { 70 | this.url = url; 71 | 72 | this._emitter = new EventEmitter(); 73 | this._channels = {}; 74 | this._channelWss = {}; 75 | 76 | this._rpcClient = buildRPCClient(url); 77 | this._ws = this._createEventsWebSocket(); 78 | 79 | // Subscribe a no-op listener for `error` events, to avoid the unhandled exception behaviour 80 | // (see https://nodejs.org/dist/v11.13.0/docs/api/events.html#events_error_events) 81 | // eslint-disable-next-line @typescript-eslint/no-empty-function 82 | this._emitter.on("error", () => {}); 83 | 84 | void this._checkVersion(); 85 | } 86 | 87 | get connected(): boolean { 88 | return this._ws.connected; 89 | } 90 | 91 | get channels(): { [path: string]: Channel } { 92 | return { ...this._channels }; 93 | } 94 | 95 | connect(): Client { 96 | if (this.connected) return this; 97 | this._ws.connect(); 98 | Object.values(this._channelWss).forEach((ws) => ws.connect()); 99 | return this; 100 | } 101 | 102 | disconnect(): Client { 103 | this._ws.disconnect(); 104 | Object.values(this._channelWss).forEach((ws) => ws.disconnect()); 105 | return this; 106 | } 107 | 108 | async getServerVersion(): Promise { 109 | return this._call("getVersion"); 110 | } 111 | 112 | async addChannel( 113 | path: string, 114 | port?: number, 115 | sendPort?: number 116 | ): Promise { 117 | const c: ServerChannel = await this._call("addChannel", { 118 | path, 119 | port, 120 | sendPort, 121 | }); 122 | return this.channels[path] || this._createChannel(c); 123 | } 124 | 125 | async removeChannel(path: string): Promise { 126 | await this._call("removeChannel", { path }); 127 | this._deleteChannel(path); 128 | } 129 | 130 | removeAllChannels(): PromiseLike { 131 | return this._call("removeAllChannels"); 132 | } 133 | 134 | bindPort(path: string, port: number): PromiseLike { 135 | return this._call("bindPort", { path, port }); 136 | } 137 | 138 | unbindPort(path: string): PromiseLike { 139 | return this._call("unbindPort", { path }); 140 | } 141 | 142 | subscribePort(path: string, port: number): PromiseLike { 143 | return this._call("subscribePort", { path, port }); 144 | } 145 | 146 | unsubscribePort(path: string, port: number): PromiseLike { 147 | return this._call("unsubscribePort", { path, port }); 148 | } 149 | 150 | unsubscribeAllPorts(path: string): PromiseLike { 151 | return this._call("unsubscribeAllPorts", { path }); 152 | } 153 | 154 | on(type: string, cb: (message: any) => void): Client { 155 | this._emitter.on(type, cb); 156 | return this; 157 | } 158 | 159 | // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types 160 | publish(path: string, msg: OSC.Message | OSC.Bundle): boolean { 161 | const dataWs = this._channelWss[path]; 162 | if (!dataWs || !dataWs.connected) { 163 | debug( 164 | "Tried to publish to %s but socket is closed or not connected", 165 | path 166 | ); 167 | return false; 168 | } 169 | debug("Publish data to %s", path); 170 | const binary = msg.pack(); 171 | dataWs.send(binary); 172 | return true; 173 | } 174 | 175 | protected _call( 176 | cmd: string, 177 | params?: { [name: string]: any } 178 | ): PromiseLike { 179 | // The request() function returns a promise of the result. 180 | // TODO: Return false if not connected 181 | debug("Call RPC method '%s' with params %O", cmd, params); 182 | return this._rpcClient.request(cmd, params); 183 | } 184 | 185 | protected _createEventsWebSocket(): ReconnectingWebSocket { 186 | const ws = new ReconnectingWebSocket(`${this.url}/events`); 187 | 188 | ws.on("message", (ev: WebSocket.MessageEvent) => { 189 | const payload = JSON.parse(ev.data as string) as ServerEventWSPayload; 190 | const { event, message } = payload; 191 | 192 | // Emit `change:${path}` events so that each Channel instance gets updated 193 | switch (event) { 194 | case "change": { 195 | const channels = message as { [path: string]: ServerChannel }; 196 | // Update existing channels, or create new channels 197 | Object.entries(channels).forEach( 198 | ([path, c]: [string, ServerChannel]) => { 199 | // Make sure Channel instance exists and is stored 200 | if (!this.channels[path]) this._createChannel(c); 201 | this._emitter.emit(`change:${path}`, c); 202 | } 203 | ); 204 | // Delete removed channels 205 | const removedChannels = Object.keys(this.channels).filter( 206 | (path) => !Object.keys(channels).includes(path) 207 | ); 208 | removedChannels.forEach((path) => this._deleteChannel(path)); 209 | break; 210 | } 211 | case "add-channel": { 212 | const { path } = message as AddChannelEventPayload; 213 | const c: ServerChannel = { path, port: null, subscribedPorts: [] }; 214 | this._createChannel(c); 215 | break; 216 | } 217 | case "remove-channel": { 218 | const { path } = message as RemoveChannelEventPayload; 219 | this._deleteChannel(path); 220 | break; 221 | } 222 | } 223 | 224 | // Finally, emit this as a client event 225 | this._emitter.emit(event, message); 226 | }); 227 | 228 | // Delegate `connect`, `disconnect` and `error` events 229 | ws.on("connect", () => this._emitter.emit("connect")); 230 | ws.on("disconnect", () => this._emitter.emit("disconnect")); 231 | ws.on("error", (error: Error) => this._emitter.emit("error", error)); 232 | 233 | return ws; 234 | } 235 | 236 | protected _createDataWebSocket(path: string): ReconnectingWebSocket { 237 | const ws = new ReconnectingWebSocket(`${this.url}/data${path}`, { 238 | binaryType: "arraybuffer", 239 | }); 240 | 241 | // eslint-disable-next-line @typescript-eslint/no-misused-promises 242 | void ws.on("message", (event: WebSocket.MessageEvent) => { 243 | debug("Received message on %s", path); 244 | try { 245 | const msg = new OSC.Message(); 246 | const binary = new DataView(event.data as ArrayBuffer); 247 | msg.unpack(binary); 248 | this._emitter.emit("message", { path, msg }); 249 | this._emitter.emit(`message:${path}`, msg); 250 | } catch (err) { 251 | // eslint-disable-next-line no-console 252 | console.error("Failed to parse OSC message:", err); 253 | } 254 | }); 255 | // Do nothing on /data errors (we already emit an error event on /events) 256 | // eslint-disable-next-line @typescript-eslint/no-empty-function 257 | ws.on("error", () => {}); 258 | 259 | return ws; 260 | } 261 | 262 | protected _createChannel(attrs: ServerChannel): Channel { 263 | const { path, subscribedPorts, port } = attrs; 264 | const channel = new Channel(this, path, subscribedPorts, port); 265 | if (!this._channelWss[path]) { 266 | this._channelWss[path] = this._createDataWebSocket(path); 267 | } 268 | this._channels[path] = channel; 269 | return channel; 270 | } 271 | 272 | protected _deleteChannel(path: string): void { 273 | const dataWs = this._channelWss[path]; 274 | if (dataWs) dataWs.disconnect(); 275 | this._emitter.emit(`remove-channel:${path}`); 276 | this._emitter.removeAllListeners(`change:${path}`); 277 | this._emitter.removeAllListeners(`remove-channel:${path}`); 278 | // TODO: Remove all listeners from `*:${path}` 279 | // ...is it possible without storing myself all handled events? 280 | delete this._channelWss[path]; 281 | delete this._channels[path]; 282 | } 283 | 284 | protected _checkVersion(): void { 285 | void this.getServerVersion().then((serverVersion) => { 286 | if (serverVersion !== __VERSION__) { 287 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 288 | const [serverMajor, serverMinor, _serverPatch] = serverVersion.split( 289 | "." 290 | ); 291 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 292 | const [major, minor, _patch] = __VERSION__.split("."); 293 | 294 | let text = `Browserglue server version is ${serverVersion}, but the client expects ${__VERSION__}.\n`; 295 | if (serverMajor !== major) { 296 | text += `API might have changed completely, so please make sure you are using the same version.\n`; 297 | } else if (serverMinor !== minor) { 298 | text += `API should not have changed, but it is still recommended to use the same version.\n`; 299 | } 300 | text += `You can download the right one at https://github.com/munshkr/browserglue/releases`; 301 | // eslint-disable-next-line no-console 302 | console.warn(text); 303 | } 304 | }); 305 | } 306 | } 307 | 308 | export default Client; 309 | -------------------------------------------------------------------------------- /src/Server.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-unsafe-member-access */ 2 | /* eslint-disable @typescript-eslint/no-unsafe-call */ 3 | /* eslint-disable @typescript-eslint/no-unsafe-assignment */ 4 | /* eslint-disable no-underscore-dangle */ 5 | import WebSocket from "ws"; 6 | import dgram from "dgram"; 7 | import express from "express"; 8 | import bodyParser from "body-parser"; 9 | import cors from "cors"; 10 | import { JSONRPCServer } from "json-rpc-2.0"; 11 | import { EventEmitter } from "events"; 12 | import { DEFAULT_PORT } from "./defaults"; 13 | import Debug from "debug"; 14 | 15 | const debug = Debug("browserglue").extend("server"); 16 | 17 | interface ServerChannel { 18 | path: string; 19 | port?: number; 20 | subscribedPorts: number[]; 21 | } 22 | 23 | interface ServerOptions { 24 | host?: string; 25 | port?: number; 26 | } 27 | 28 | type AddChannelParams = { path: string; port?: number; sendPort?: number }; 29 | type RemoveChannelParams = { path: string }; 30 | type BindPortParams = { path: string; port: number }; 31 | type UnbindPortParams = { path: string }; 32 | type SubscribePortParams = { path: string; port: number }; 33 | type UnsubscribePortParams = { path: string; port: number }; 34 | type UnsubscribeAllPortsParams = { path: string }; 35 | 36 | const buildRPCServer = (server: Server) => { 37 | // Create JSON-RPC server 38 | const rpcServer = new JSONRPCServer(); 39 | 40 | // Define RPC methods 41 | rpcServer.addMethod("getVersion", () => { 42 | return __VERSION__; 43 | }); 44 | 45 | rpcServer.addMethod( 46 | "addChannel", 47 | ({ path, port, sendPort }: AddChannelParams) => { 48 | return server.addChannel(path, port, sendPort); 49 | } 50 | ); 51 | 52 | rpcServer.addMethod("removeChannel", ({ path }: RemoveChannelParams) => { 53 | return server.removeChannel(path); 54 | }); 55 | 56 | rpcServer.addMethod("removeAllChannels", () => { 57 | server.removeAllChannels(); 58 | }); 59 | 60 | rpcServer.addMethod("bindPort", ({ path, port }: BindPortParams) => { 61 | return server.bindPort(path, port); 62 | }); 63 | 64 | rpcServer.addMethod("unbindPort", ({ path }: UnbindPortParams) => { 65 | return server.unbindPort(path); 66 | }); 67 | 68 | rpcServer.addMethod( 69 | "subscribePort", 70 | ({ path, port }: SubscribePortParams) => { 71 | return server.subscribePort(path, port); 72 | } 73 | ); 74 | 75 | rpcServer.addMethod( 76 | "unsubscribePort", 77 | ({ path, port }: UnsubscribePortParams) => { 78 | return server.unsubscribePort(path, port); 79 | } 80 | ); 81 | 82 | rpcServer.addMethod( 83 | "unsubscribeAllPorts", 84 | ({ path }: UnsubscribeAllPortsParams) => { 85 | return server.unsubscribeAllPorts(path); 86 | } 87 | ); 88 | 89 | return rpcServer; 90 | }; 91 | 92 | const eventsToBroadcast = [ 93 | "changed", 94 | "add-channel", 95 | "remove-channel", 96 | "bind-port", 97 | "unbind-port", 98 | "subscribe-port", 99 | "unsubscribe-port", 100 | ]; 101 | 102 | class Server { 103 | readonly host: string; 104 | readonly port: number; 105 | 106 | protected _emitter: EventEmitter; 107 | protected _wss: WebSocket.Server; 108 | protected _channels: { [path: string]: ServerChannel }; 109 | protected _sockets: { [path: string]: dgram.Socket }; 110 | protected _wsClients: { [path: string]: Set }; 111 | protected _wsEventClients: Set; 112 | protected _server: string; 113 | 114 | constructor( 115 | { host, port }: ServerOptions = { host: "localhost", port: DEFAULT_PORT } 116 | ) { 117 | this.host = host; 118 | this.port = port; 119 | 120 | this._emitter = new EventEmitter(); 121 | this._channels = {}; 122 | this._sockets = {}; 123 | this._wsClients = {}; 124 | this._wsEventClients = new Set(); 125 | } 126 | 127 | start(): void { 128 | // Create WebSockets servers for both RPC interface and data 129 | const wss = new WebSocket.Server({ noServer: true }); 130 | this._wss = wss; 131 | 132 | const wsDebug = debug.extend("ws"); 133 | 134 | wss.on("connection", (ws, req) => { 135 | wsDebug("connection: %o", req.url); 136 | 137 | // TODO: Check if url is any of the valid paths (/events, /data/*), and throw error otherwise 138 | if (req.url.startsWith("/data")) { 139 | const path = req.url.split("/data")[1]; 140 | if (!this._wsClients[path]) { 141 | this._wsClients[path] = new Set(); 142 | } 143 | this._wsClients[path].add(ws); 144 | 145 | ws.on("message", (data) => { 146 | wsDebug("%s received: %s", path, data); 147 | this._broadcast(path, data); 148 | }); 149 | } else if (req.url.startsWith("/events")) { 150 | this._wsEventClients.add(ws); 151 | 152 | // Send a "change" payload so that client has the latest server state 153 | debug("Send first 'change' event to have latest state"); 154 | const payload = { event: "change", message: this._channels }; 155 | ws.send(JSON.stringify(payload)); 156 | } 157 | 158 | ws.on("error", (err) => { 159 | wsDebug("client error: %o", err); 160 | }); 161 | 162 | ws.on("close", () => { 163 | wsDebug("client closed"); 164 | }); 165 | }); 166 | 167 | const app = express(); 168 | 169 | app.use(bodyParser.json()); 170 | 171 | // Allow RPC requests from anywhere 172 | // TODO: Maybe allow CORS only on some trusted hosts specified by the user? 173 | app.use(cors()); 174 | 175 | // Create and setup JSON-RPC server 176 | const rpcServer = buildRPCServer(this); 177 | 178 | // Setup HTTP endpoint for JSON-RPC server 179 | app.post("/json-rpc", (req, res) => { 180 | const jsonRPCRequest = req.body; 181 | // server.receive takes a JSON-RPC request and returns a promise of a JSON-RPC response. 182 | void rpcServer.receive(jsonRPCRequest).then((jsonRPCResponse) => { 183 | if (jsonRPCResponse) { 184 | res.json(jsonRPCResponse); 185 | } else { 186 | // If response is absent, it was a JSON-RPC notification method. 187 | // Respond with no content status (204). 188 | res.sendStatus(204); 189 | } 190 | }); 191 | }); 192 | 193 | // Create HTTP server and start listening 194 | const server = app.listen(this.port, this.host); 195 | this._server = server; 196 | 197 | // Handle upgrade requests to WebSockets 198 | server.on("upgrade", (request, socket, head) => { 199 | wss.handleUpgrade(request, socket, head, (ws) => { 200 | wss.emit("connection", ws, request); 201 | }); 202 | }); 203 | 204 | const debugServer = debug.extend("http"); 205 | 206 | server.on("listening", () => { 207 | debugServer("listening"); 208 | this._emitter.emit("listening"); 209 | }); 210 | 211 | server.on("close", () => { 212 | debugServer("closed"); 213 | this._emitter.emit("close"); 214 | }); 215 | 216 | server.on("error", (err) => { 217 | debugServer("error: %o", err); 218 | this._emitter.emit("error", err); 219 | }); 220 | 221 | // For every event to broadcast, send to all WS clients subscribed to /events 222 | eventsToBroadcast.forEach((event) => { 223 | this._emitter.on(event, (message) => { 224 | this._emitServerEvent(event, message); 225 | // Also send a "change" event with the Server state (channels object) 226 | this._emitServerChangeEvent(); 227 | }); 228 | }); 229 | } 230 | 231 | on(event: string, cb: (...args: any[]) => void): EventEmitter { 232 | return this._emitter.on(event, cb); 233 | } 234 | 235 | addChannel(path: string, port?: number, sendPort?: number): ServerChannel { 236 | // If channel already exists, return it 237 | if (Object.keys(this._channels).includes(path)) { 238 | debug("Channel already exists"); 239 | return this._channels[path]; 240 | } 241 | 242 | debug(`Add channel ${path}`); 243 | const newChannel: ServerChannel = { 244 | path, 245 | port, 246 | subscribedPorts: [], 247 | }; 248 | this._channels[path] = newChannel; 249 | this._emitter.emit("add-channel", { path }); 250 | 251 | const socket = dgram.createSocket("udp4"); 252 | this._sockets[path] = socket; 253 | 254 | // If port argument is present, bind it 255 | if (port) { 256 | this.bindPort(path, port); 257 | } 258 | 259 | // If sendPort is present, subscribe it 260 | if (sendPort) { 261 | this.subscribePort(path, sendPort); 262 | } 263 | 264 | return newChannel; 265 | } 266 | 267 | removeChannel(path: string): boolean { 268 | const socket = this._sockets[path]; 269 | if (socket) { 270 | debug(`Remove channel %s`, path); 271 | try { 272 | socket.close(); 273 | } catch (err) { 274 | debug("Socket is already closed: %o", err); 275 | } 276 | } 277 | // Clean up 278 | delete this._channels[path]; 279 | delete this._sockets[path]; 280 | delete this._wsClients[path]; 281 | if (!socket) return false; 282 | this._emitter.emit("remove-channel", { path }); 283 | return true; 284 | } 285 | 286 | removeAllChannels(): void { 287 | debug("Remove all channels"); 288 | Object.keys(this._channels).forEach((path) => { 289 | this.removeChannel(path); 290 | }); 291 | } 292 | 293 | bindPort(path: string, port: number): boolean { 294 | const channel = this._channels[path]; 295 | if (!channel) return false; 296 | 297 | if (channel.port) { 298 | if (channel.port !== port) { 299 | debug( 300 | `Channel %s already has a binded port at %d. ` + 301 | `Will re-create socket.`, 302 | path, 303 | channel.port 304 | ); 305 | } 306 | try { 307 | this._sockets[path].close(); 308 | } catch (err) { 309 | debug("Socket is already closed: %o", err); 310 | } 311 | this._sockets[path] = dgram.createSocket("udp4"); 312 | } 313 | 314 | const socket = this._sockets[path]; 315 | const udpDebug = debug.extend("udp"); 316 | 317 | socket.on("listening", () => { 318 | const address = socket.address(); 319 | udpDebug(`Socket binded at port %d`, address.port); 320 | }); 321 | 322 | socket.on("error", (err) => { 323 | udpDebug(`socket error:\n%o`, err.stack); 324 | socket.close(); 325 | // TODO: Reject promise with error? 326 | }); 327 | 328 | socket.on("message", (buffer, rinfo) => { 329 | udpDebug(`socket got: %s from %s:%d`, port, rinfo.address, rinfo.port); 330 | 331 | // Broadcast message to all subscribed clients on /data/{path} 332 | const wsClients = this._wsClients[path] || []; 333 | wsClients.forEach((client: WebSocket) => { 334 | if (client.readyState === WebSocket.OPEN) { 335 | client.send(buffer); 336 | } 337 | }); 338 | }); 339 | 340 | debug(`Bind socket of channel %s to port %d`, path, port); 341 | socket.bind({ address: "0.0.0.0", port }); 342 | channel.port = port; 343 | 344 | this._emitter.emit("bind-port", { path, port }); 345 | 346 | return true; 347 | } 348 | 349 | unbindPort(path: string): boolean { 350 | const channel = this._channels[path]; 351 | if (!channel) return false; 352 | 353 | debug(`Unbind port of socket channel %s`, path); 354 | 355 | // Try to close socket 356 | const oldSocket = this._sockets[path]; 357 | try { 358 | oldSocket.close(); 359 | } catch (err) { 360 | debug("Socket is already closed: %o", err); 361 | } 362 | channel.port = null; 363 | 364 | // Create new socket 365 | const socket = dgram.createSocket("udp4"); 366 | this._sockets[path] = socket; 367 | 368 | this._emitter.emit("unbind-port", { path }); 369 | return true; 370 | } 371 | 372 | subscribePort(path: string, port: number): boolean { 373 | if (!this._channels[path]) return false; 374 | debug(`Subscribe port %d on channel %s`, port, path); 375 | if (!this._channels[path].subscribedPorts.includes(port)) { 376 | this._channels[path].subscribedPorts.push(port); 377 | } 378 | this._emitter.emit("subscribe-port", { path, port }); 379 | return true; 380 | } 381 | 382 | unsubscribePort(path: string, port: number): boolean { 383 | if (!this._channels[path]) return false; 384 | debug(`Unsubscribe port %d from channel %s`, port, path); 385 | const newPorts = this._channels[path].subscribedPorts.filter( 386 | (p) => p !== port 387 | ); 388 | if (newPorts === this._channels[path].subscribedPorts) return false; 389 | this._channels[path].subscribedPorts = newPorts; 390 | this._emitter.emit("unsubscribe-port", { path, port }); 391 | return true; 392 | } 393 | 394 | unsubscribeAllPorts(path: string): boolean { 395 | if (!this._channels[path]) return false; 396 | debug(`Unsubscribe all ports from channel %s`, path); 397 | const oldSubscribedPorts = this._channels[path].subscribedPorts; 398 | this._channels[path].subscribedPorts = []; 399 | oldSubscribedPorts.forEach((port) => { 400 | this._emitter.emit("unsubscribe-port", { path, port }); 401 | }); 402 | return true; 403 | } 404 | 405 | // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types 406 | protected _broadcast(path: string, data: any): void { 407 | const channel = this._channels[path]; 408 | const socket = this._sockets[path]; 409 | if (!socket || !channel) return; 410 | 411 | const subscribedPorts = channel.subscribedPorts; 412 | if (socket && subscribedPorts) { 413 | subscribedPorts.forEach((port) => { 414 | socket.send(data, port); 415 | }); 416 | } 417 | } 418 | 419 | protected _emitServerChangeEvent(): void { 420 | this._emitServerEvent("change", this._channels); 421 | } 422 | 423 | // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types 424 | protected _emitServerEvent(event: string | symbol, message?: any): void { 425 | const payload = { event, message }; 426 | this._wsEventClients.forEach((ws) => { 427 | ws.send(JSON.stringify(payload)); 428 | }); 429 | } 430 | } 431 | 432 | export default Server; 433 | -------------------------------------------------------------------------------- /media/osc-apps.excalidraw: -------------------------------------------------------------------------------- 1 | { 2 | "type": "excalidraw", 3 | "version": 2, 4 | "source": "https://excalidraw.com", 5 | "elements": [ 6 | { 7 | "type": "rectangle", 8 | "version": 181, 9 | "versionNonce": 1977235629, 10 | "isDeleted": false, 11 | "id": "SiEgfJDo-gIU7M7e6eLrU", 12 | "fillStyle": "hachure", 13 | "strokeWidth": 1, 14 | "strokeStyle": "solid", 15 | "roughness": 2, 16 | "opacity": 100, 17 | "angle": 0, 18 | "x": 364.00000000000006, 19 | "y": 253, 20 | "strokeColor": "#000000", 21 | "backgroundColor": "transparent", 22 | "width": 215.9999999999999, 23 | "height": 174, 24 | "seed": 61166339, 25 | "groupIds": [], 26 | "strokeSharpness": "round", 27 | "boundElementIds": null 28 | }, 29 | { 30 | "type": "text", 31 | "version": 127, 32 | "versionNonce": 377795747, 33 | "isDeleted": false, 34 | "id": "etxYC3QCoMtVTA6FzGK4j", 35 | "fillStyle": "hachure", 36 | "strokeWidth": 1, 37 | "strokeStyle": "solid", 38 | "roughness": 1, 39 | "opacity": 100, 40 | "angle": 0, 41 | "x": 422, 42 | "y": 278, 43 | "strokeColor": "#000000", 44 | "backgroundColor": "transparent", 45 | "width": 98, 46 | "height": 50, 47 | "seed": 216295907, 48 | "groupIds": [], 49 | "strokeSharpness": "sharp", 50 | "boundElementIds": [], 51 | "fontSize": 20, 52 | "fontFamily": 1, 53 | "text": "OSC app\nonly sends", 54 | "baseline": 43, 55 | "textAlign": "center", 56 | "verticalAlign": "top" 57 | }, 58 | { 59 | "type": "rectangle", 60 | "version": 194, 61 | "versionNonce": 147364621, 62 | "isDeleted": false, 63 | "id": "p796_hSYzYVcYnoSzKj0O", 64 | "fillStyle": "hachure", 65 | "strokeWidth": 1, 66 | "strokeStyle": "solid", 67 | "roughness": 2, 68 | "opacity": 100, 69 | "angle": 0, 70 | "x": 615, 71 | "y": 260, 72 | "strokeColor": "#000000", 73 | "backgroundColor": "transparent", 74 | "width": 186, 75 | "height": 160.99999999999997, 76 | "seed": 351841859, 77 | "groupIds": [], 78 | "strokeSharpness": "round", 79 | "boundElementIds": null 80 | }, 81 | { 82 | "type": "text", 83 | "version": 149, 84 | "versionNonce": 971778115, 85 | "isDeleted": false, 86 | "id": "TUCYQS7PVsARIlN4w4g9d", 87 | "fillStyle": "hachure", 88 | "strokeWidth": 1, 89 | "strokeStyle": "solid", 90 | "roughness": 1, 91 | "opacity": 100, 92 | "angle": 0, 93 | "x": 649.5, 94 | "y": 286.5, 95 | "strokeColor": "#000000", 96 | "backgroundColor": "transparent", 97 | "width": 121, 98 | "height": 50, 99 | "seed": 385148941, 100 | "groupIds": [], 101 | "strokeSharpness": "sharp", 102 | "boundElementIds": [], 103 | "fontSize": 20, 104 | "fontFamily": 1, 105 | "text": "OSC app\nonly receives", 106 | "baseline": 43, 107 | "textAlign": "center", 108 | "verticalAlign": "top" 109 | }, 110 | { 111 | "type": "rectangle", 112 | "version": 234, 113 | "versionNonce": 1216065901, 114 | "isDeleted": false, 115 | "id": "hidKc84OHN7tYyC6xjnqU", 116 | "fillStyle": "hachure", 117 | "strokeWidth": 1, 118 | "strokeStyle": "solid", 119 | "roughness": 2, 120 | "opacity": 100, 121 | "angle": 0, 122 | "x": 837, 123 | "y": 248, 124 | "strokeColor": "#000000", 125 | "backgroundColor": "transparent", 126 | "width": 212.9999999999999, 127 | "height": 174, 128 | "seed": 1662925187, 129 | "groupIds": [], 130 | "strokeSharpness": "round", 131 | "boundElementIds": null 132 | }, 133 | { 134 | "type": "text", 135 | "version": 212, 136 | "versionNonce": 1399072739, 137 | "isDeleted": false, 138 | "id": "asQci9s-YPjyMT-28mEzW", 139 | "fillStyle": "hachure", 140 | "strokeWidth": 1, 141 | "strokeStyle": "solid", 142 | "roughness": 1, 143 | "opacity": 100, 144 | "angle": 0, 145 | "x": 863.5, 146 | "y": 269.5, 147 | "strokeColor": "#000000", 148 | "backgroundColor": "transparent", 149 | "width": 162, 150 | "height": 75, 151 | "seed": 2063102989, 152 | "groupIds": [], 153 | "strokeSharpness": "sharp", 154 | "boundElementIds": [], 155 | "fontSize": 20, 156 | "fontFamily": 1, 157 | "text": "OSC app\nsends + receives\non same socket", 158 | "baseline": 68, 159 | "textAlign": "center", 160 | "verticalAlign": "top" 161 | }, 162 | { 163 | "type": "rectangle", 164 | "version": 144, 165 | "versionNonce": 574421965, 166 | "isDeleted": false, 167 | "id": "2Bi7q6xwGSnnrJNxcxTo0", 168 | "fillStyle": "hachure", 169 | "strokeWidth": 1, 170 | "strokeStyle": "solid", 171 | "roughness": 1, 172 | "opacity": 100, 173 | "angle": 0, 174 | "x": 382, 175 | "y": 345, 176 | "strokeColor": "#000000", 177 | "backgroundColor": "transparent", 178 | "width": 178, 179 | "height": 66.00000000000001, 180 | "seed": 390531459, 181 | "groupIds": [], 182 | "strokeSharpness": "round", 183 | "boundElementIds": [] 184 | }, 185 | { 186 | "type": "text", 187 | "version": 215, 188 | "versionNonce": 76988707, 189 | "isDeleted": false, 190 | "id": "0SIsaebh5xwhSfu_fYsgc", 191 | "fillStyle": "hachure", 192 | "strokeWidth": 1, 193 | "strokeStyle": "dashed", 194 | "roughness": 1, 195 | "opacity": 100, 196 | "angle": 0, 197 | "x": 394.5, 198 | "y": 359.5, 199 | "strokeColor": "#000000", 200 | "backgroundColor": "transparent", 201 | "width": 150, 202 | "height": 38, 203 | "seed": 1801973923, 204 | "groupIds": [], 205 | "strokeSharpness": "round", 206 | "boundElementIds": [ 207 | "4SSAE3xglddMS10TbuU8U" 208 | ], 209 | "fontSize": 16, 210 | "fontFamily": 3, 211 | "text": "udp:4000\n(or random port)", 212 | "baseline": 34, 213 | "textAlign": "center", 214 | "verticalAlign": "top" 215 | }, 216 | { 217 | "type": "rectangle", 218 | "version": 195, 219 | "versionNonce": 505805357, 220 | "isDeleted": false, 221 | "id": "G8yU4sEfyUChZwiPH7hUr", 222 | "fillStyle": "hachure", 223 | "strokeWidth": 1, 224 | "strokeStyle": "solid", 225 | "roughness": 1, 226 | "opacity": 100, 227 | "angle": 0, 228 | "x": 642, 229 | "y": 356, 230 | "strokeColor": "#000000", 231 | "backgroundColor": "transparent", 232 | "width": 131.9999999999999, 233 | "height": 44.000000000000014, 234 | "seed": 1878116141, 235 | "groupIds": [], 236 | "strokeSharpness": "round", 237 | "boundElementIds": null 238 | }, 239 | { 240 | "type": "text", 241 | "version": 162, 242 | "versionNonce": 988793635, 243 | "isDeleted": false, 244 | "id": "gc1mwgEV2BJzGBaeYbkg_", 245 | "fillStyle": "hachure", 246 | "strokeWidth": 1, 247 | "strokeStyle": "dashed", 248 | "roughness": 1, 249 | "opacity": 100, 250 | "angle": 0, 251 | "x": 667, 252 | "y": 367, 253 | "strokeColor": "#000000", 254 | "backgroundColor": "transparent", 255 | "width": 84, 256 | "height": 19, 257 | "seed": 1098521219, 258 | "groupIds": [], 259 | "strokeSharpness": "round", 260 | "boundElementIds": [ 261 | "TXUnovcnBjNynVOgbExpy" 262 | ], 263 | "fontSize": 16, 264 | "fontFamily": 3, 265 | "text": "udp:57120", 266 | "baseline": 15, 267 | "textAlign": "left", 268 | "verticalAlign": "top" 269 | }, 270 | { 271 | "type": "rectangle", 272 | "version": 281, 273 | "versionNonce": 85994637, 274 | "isDeleted": false, 275 | "id": "PcaQOd_NYyaiPtcHkBo-1", 276 | "fillStyle": "hachure", 277 | "strokeWidth": 1, 278 | "strokeStyle": "solid", 279 | "roughness": 1, 280 | "opacity": 100, 281 | "angle": 0, 282 | "x": 889, 283 | "y": 360, 284 | "strokeColor": "#000000", 285 | "backgroundColor": "transparent", 286 | "width": 113.99999999999989, 287 | "height": 42.000000000000014, 288 | "seed": 328315107, 289 | "groupIds": [], 290 | "strokeSharpness": "round", 291 | "boundElementIds": [ 292 | "p-dxtfmmF4QkhNvN6UnI1", 293 | "eT_OEoWNxh3SNOTuMNKtq", 294 | "M0CfANNm6Bj5HGQtbRL94", 295 | "Fv_PYMeXRywWx8T6KtGQE" 296 | ] 297 | }, 298 | { 299 | "type": "text", 300 | "version": 197, 301 | "versionNonce": 2108714691, 302 | "isDeleted": false, 303 | "id": "1tnhjRciiIO_AF2UzsGHS", 304 | "fillStyle": "hachure", 305 | "strokeWidth": 1, 306 | "strokeStyle": "dashed", 307 | "roughness": 1, 308 | "opacity": 100, 309 | "angle": 0, 310 | "x": 909, 311 | "y": 370, 312 | "strokeColor": "#000000", 313 | "backgroundColor": "transparent", 314 | "width": 75, 315 | "height": 19, 316 | "seed": 1016044675, 317 | "groupIds": [], 318 | "strokeSharpness": "round", 319 | "boundElementIds": null, 320 | "fontSize": 16, 321 | "fontFamily": 3, 322 | "text": "udp:4567", 323 | "baseline": 15, 324 | "textAlign": "left", 325 | "verticalAlign": "top" 326 | }, 327 | { 328 | "type": "arrow", 329 | "version": 248, 330 | "versionNonce": 1189417709, 331 | "isDeleted": false, 332 | "id": "TXUnovcnBjNynVOgbExpy", 333 | "fillStyle": "hachure", 334 | "strokeWidth": 1, 335 | "strokeStyle": "solid", 336 | "roughness": 1, 337 | "opacity": 100, 338 | "angle": 0, 339 | "x": 715.7274482688122, 340 | "y": 505.60392641089857, 341 | "strokeColor": "#000000", 342 | "backgroundColor": "transparent", 343 | "width": 2.322481197194975, 344 | "height": 115.60392641089851, 345 | "seed": 2120825613, 346 | "groupIds": [], 347 | "strokeSharpness": "round", 348 | "boundElementIds": null, 349 | "startBinding": null, 350 | "endBinding": { 351 | "elementId": "gc1mwgEV2BJzGBaeYbkg_", 352 | "focus": -0.09797744752696, 353 | "gap": 4.000000000000057 354 | }, 355 | "points": [ 356 | [ 357 | 0, 358 | 0 359 | ], 360 | [ 361 | -2.322481197194975, 362 | -115.60392641089851 363 | ] 364 | ], 365 | "lastCommittedPoint": null, 366 | "startArrowhead": "bar", 367 | "endArrowhead": "arrow" 368 | }, 369 | { 370 | "type": "arrow", 371 | "version": 224, 372 | "versionNonce": 1406901859, 373 | "isDeleted": false, 374 | "id": "4SSAE3xglddMS10TbuU8U", 375 | "fillStyle": "hachure", 376 | "strokeWidth": 1, 377 | "strokeStyle": "solid", 378 | "roughness": 1, 379 | "opacity": 100, 380 | "angle": 0, 381 | "x": 467.8797828335057, 382 | "y": 407, 383 | "strokeColor": "#000000", 384 | "backgroundColor": "transparent", 385 | "width": 2.522228813942206, 386 | "height": 103.17138203974815, 387 | "seed": 795969507, 388 | "groupIds": [], 389 | "strokeSharpness": "round", 390 | "boundElementIds": null, 391 | "startBinding": { 392 | "elementId": "0SIsaebh5xwhSfu_fYsgc", 393 | "focus": 0.030702599902103427, 394 | "gap": 9.5 395 | }, 396 | "endBinding": null, 397 | "points": [ 398 | [ 399 | 0, 400 | 0 401 | ], 402 | [ 403 | 2.522228813942206, 404 | 103.17138203974815 405 | ] 406 | ], 407 | "lastCommittedPoint": null, 408 | "startArrowhead": null, 409 | "endArrowhead": "arrow" 410 | }, 411 | { 412 | "type": "rectangle", 413 | "version": 327, 414 | "versionNonce": 98752867, 415 | "isDeleted": false, 416 | "id": "LYLGxD_S3fF4T2JfZoal7", 417 | "fillStyle": "hachure", 418 | "strokeWidth": 1, 419 | "strokeStyle": "solid", 420 | "roughness": 2, 421 | "opacity": 100, 422 | "angle": 0, 423 | "x": 1085.5, 424 | "y": 247, 425 | "strokeColor": "#000000", 426 | "backgroundColor": "transparent", 427 | "width": 274.99999999999994, 428 | "height": 208, 429 | "seed": 1106079597, 430 | "groupIds": [], 431 | "strokeSharpness": "round", 432 | "boundElementIds": [] 433 | }, 434 | { 435 | "type": "text", 436 | "version": 251, 437 | "versionNonce": 138402307, 438 | "isDeleted": false, 439 | "id": "HpJAWXiSGq1LS1gm__xzy", 440 | "fillStyle": "hachure", 441 | "strokeWidth": 1, 442 | "strokeStyle": "solid", 443 | "roughness": 1, 444 | "opacity": 100, 445 | "angle": 0, 446 | "x": 1112.5, 447 | "y": 268.5, 448 | "strokeColor": "#000000", 449 | "backgroundColor": "transparent", 450 | "width": 203, 451 | "height": 75, 452 | "seed": 829770211, 453 | "groupIds": [], 454 | "strokeSharpness": "sharp", 455 | "boundElementIds": [], 456 | "fontSize": 20, 457 | "fontFamily": 1, 458 | "text": "OSC app \nsends + receives\non different sockets", 459 | "baseline": 68, 460 | "textAlign": "center", 461 | "verticalAlign": "top" 462 | }, 463 | { 464 | "type": "rectangle", 465 | "version": 355, 466 | "versionNonce": 377707587, 467 | "isDeleted": false, 468 | "id": "Nk5jhdmHCl_tibE_nQmuN", 469 | "fillStyle": "hachure", 470 | "strokeWidth": 1, 471 | "strokeStyle": "solid", 472 | "roughness": 1, 473 | "opacity": 100, 474 | "angle": 0, 475 | "x": 1105.5, 476 | "y": 365, 477 | "strokeColor": "#000000", 478 | "backgroundColor": "transparent", 479 | "width": 125.00000000000004, 480 | "height": 72.00000000000007, 481 | "seed": 1120336333, 482 | "groupIds": [], 483 | "strokeSharpness": "round", 484 | "boundElementIds": [ 485 | "QXJJpQFolrOCpLl8DFB68", 486 | "tyebA2xV9IZzuHLea6jhQ", 487 | "v3ASna6vs9uSUsk1IWShf" 488 | ] 489 | }, 490 | { 491 | "type": "rectangle", 492 | "version": 422, 493 | "versionNonce": 789469645, 494 | "isDeleted": false, 495 | "id": "HdihzaXutV38lu_7z9z9O", 496 | "fillStyle": "hachure", 497 | "strokeWidth": 1, 498 | "strokeStyle": "solid", 499 | "roughness": 1, 500 | "opacity": 100, 501 | "angle": 0, 502 | "x": 1244.5, 503 | "y": 380.5, 504 | "strokeColor": "#000000", 505 | "backgroundColor": "transparent", 506 | "width": 100.9999999999999, 507 | "height": 47.000000000000036, 508 | "seed": 786974957, 509 | "groupIds": [], 510 | "strokeSharpness": "round", 511 | "boundElementIds": [ 512 | "QXJJpQFolrOCpLl8DFB68", 513 | "tyebA2xV9IZzuHLea6jhQ", 514 | "f_q0tqfbcO2OJ-3PeNkFF" 515 | ] 516 | }, 517 | { 518 | "type": "text", 519 | "version": 409, 520 | "versionNonce": 467498307, 521 | "isDeleted": false, 522 | "id": "4dVDvvRxik4dWmgwQYZ4Z", 523 | "fillStyle": "hachure", 524 | "strokeWidth": 1, 525 | "strokeStyle": "dashed", 526 | "roughness": 1, 527 | "opacity": 100, 528 | "angle": 0, 529 | "x": 1257.5, 530 | "y": 394.5, 531 | "strokeColor": "#000000", 532 | "backgroundColor": "transparent", 533 | "width": 75, 534 | "height": 19, 535 | "seed": 1229899875, 536 | "groupIds": [], 537 | "strokeSharpness": "round", 538 | "boundElementIds": null, 539 | "fontSize": 16, 540 | "fontFamily": 3, 541 | "text": "udp:4001", 542 | "baseline": 15, 543 | "textAlign": "left", 544 | "verticalAlign": "top" 545 | }, 546 | { 547 | "type": "arrow", 548 | "version": 200, 549 | "versionNonce": 764370499, 550 | "isDeleted": false, 551 | "id": "v3ASna6vs9uSUsk1IWShf", 552 | "fillStyle": "hachure", 553 | "strokeWidth": 1, 554 | "strokeStyle": "solid", 555 | "roughness": 1, 556 | "opacity": 100, 557 | "angle": 0, 558 | "x": 1168.155164983741, 559 | "y": 444.6595744680851, 560 | "strokeColor": "#000000", 561 | "backgroundColor": "transparent", 562 | "width": 2.1563742080779775, 563 | "height": 77.37351558206092, 564 | "seed": 1548445411, 565 | "groupIds": [], 566 | "strokeSharpness": "round", 567 | "boundElementIds": [], 568 | "startBinding": { 569 | "elementId": "x8UhWx28NfJIDHvtKKiHw", 570 | "focus": -0.028705164708581477, 571 | "gap": 15.159574468085054 572 | }, 573 | "endBinding": null, 574 | "points": [ 575 | [ 576 | 0, 577 | 0 578 | ], 579 | [ 580 | -2.1563742080779775, 581 | 77.37351558206092 582 | ] 583 | ], 584 | "lastCommittedPoint": null, 585 | "startArrowhead": null, 586 | "endArrowhead": "arrow" 587 | }, 588 | { 589 | "type": "arrow", 590 | "version": 205, 591 | "versionNonce": 656927203, 592 | "isDeleted": false, 593 | "id": "f_q0tqfbcO2OJ-3PeNkFF", 594 | "fillStyle": "hachure", 595 | "strokeWidth": 1, 596 | "strokeStyle": "solid", 597 | "roughness": 1, 598 | "opacity": 100, 599 | "angle": 0, 600 | "x": 1288.7350962433964, 601 | "y": 526.0307649876922, 602 | "strokeColor": "#000000", 603 | "backgroundColor": "transparent", 604 | "width": 0.24449366125168126, 605 | "height": 96.03076498769224, 606 | "seed": 393286317, 607 | "groupIds": [], 608 | "strokeSharpness": "round", 609 | "boundElementIds": null, 610 | "startBinding": null, 611 | "endBinding": { 612 | "elementId": "HdihzaXutV38lu_7z9z9O", 613 | "focus": 0.13005568113226545, 614 | "gap": 2.4999999999999716 615 | }, 616 | "points": [ 617 | [ 618 | 0, 619 | 0 620 | ], 621 | [ 622 | -0.24449366125168126, 623 | -96.03076498769224 624 | ] 625 | ], 626 | "lastCommittedPoint": null, 627 | "startArrowhead": "bar", 628 | "endArrowhead": "arrow" 629 | }, 630 | { 631 | "type": "arrow", 632 | "version": 114, 633 | "versionNonce": 2027593421, 634 | "isDeleted": false, 635 | "id": "M0CfANNm6Bj5HGQtbRL94", 636 | "fillStyle": "hachure", 637 | "strokeWidth": 1, 638 | "strokeStyle": "solid", 639 | "roughness": 1, 640 | "opacity": 100, 641 | "angle": 0, 642 | "x": 927, 643 | "y": 407, 644 | "strokeColor": "#000000", 645 | "backgroundColor": "transparent", 646 | "width": 0, 647 | "height": 111, 648 | "seed": 595336333, 649 | "groupIds": [], 650 | "strokeSharpness": "round", 651 | "boundElementIds": null, 652 | "startBinding": { 653 | "elementId": "PcaQOd_NYyaiPtcHkBo-1", 654 | "focus": 0.33333333333333365, 655 | "gap": 5 656 | }, 657 | "endBinding": null, 658 | "points": [ 659 | [ 660 | 0, 661 | 0 662 | ], 663 | [ 664 | 0, 665 | 111 666 | ] 667 | ], 668 | "lastCommittedPoint": null, 669 | "startArrowhead": null, 670 | "endArrowhead": "arrow" 671 | }, 672 | { 673 | "type": "arrow", 674 | "version": 107, 675 | "versionNonce": 247283843, 676 | "isDeleted": false, 677 | "id": "Fv_PYMeXRywWx8T6KtGQE", 678 | "fillStyle": "hachure", 679 | "strokeWidth": 1, 680 | "strokeStyle": "solid", 681 | "roughness": 1, 682 | "opacity": 100, 683 | "angle": 0, 684 | "x": 967, 685 | "y": 516, 686 | "strokeColor": "#000000", 687 | "backgroundColor": "transparent", 688 | "width": 2, 689 | "height": 107, 690 | "seed": 1486626627, 691 | "groupIds": [], 692 | "strokeSharpness": "round", 693 | "boundElementIds": null, 694 | "startBinding": null, 695 | "endBinding": { 696 | "elementId": "PcaQOd_NYyaiPtcHkBo-1", 697 | "focus": -0.3219345383488035, 698 | "gap": 7 699 | }, 700 | "points": [ 701 | [ 702 | 0, 703 | 0 704 | ], 705 | [ 706 | -2, 707 | -107 708 | ] 709 | ], 710 | "lastCommittedPoint": null, 711 | "startArrowhead": "bar", 712 | "endArrowhead": "arrow" 713 | }, 714 | { 715 | "id": "x8UhWx28NfJIDHvtKKiHw", 716 | "type": "text", 717 | "x": 1121, 718 | "y": 372.50000000000006, 719 | "width": 94, 720 | "height": 57, 721 | "angle": 0, 722 | "strokeColor": "#000000", 723 | "backgroundColor": "transparent", 724 | "fillStyle": "hachure", 725 | "strokeWidth": 1, 726 | "strokeStyle": "solid", 727 | "roughness": 2, 728 | "opacity": 100, 729 | "groupIds": [], 730 | "strokeSharpness": "round", 731 | "seed": 1010927565, 732 | "version": 33, 733 | "versionNonce": 1011800941, 734 | "isDeleted": false, 735 | "boundElementIds": [ 736 | "v3ASna6vs9uSUsk1IWShf" 737 | ], 738 | "text": "udp:4000\n(or random\nport)", 739 | "fontSize": 16, 740 | "fontFamily": 3, 741 | "textAlign": "center", 742 | "verticalAlign": "middle", 743 | "baseline": 53 744 | } 745 | ], 746 | "appState": { 747 | "gridSize": null, 748 | "viewBackgroundColor": "#ffffff" 749 | } 750 | } -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published 637 | by the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | -------------------------------------------------------------------------------- /media/osc-apps.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | OSC apponly sendsOSC apponly receivesOSC appsends + receiveson same socketudp:4000(or random port)udp:57120udp:4567OSC app sends + receiveson different socketsudp:4001udp:4000(or randomport) -------------------------------------------------------------------------------- /media/internals.excalidraw: -------------------------------------------------------------------------------- 1 | { 2 | "type": "excalidraw", 3 | "version": 2, 4 | "source": "https://excalidraw.com", 5 | "elements": [ 6 | { 7 | "type": "rectangle", 8 | "version": 312, 9 | "versionNonce": 896974029, 10 | "isDeleted": false, 11 | "id": "HMjyteFfI7ZlyrYywNRD9", 12 | "fillStyle": "hachure", 13 | "strokeWidth": 1, 14 | "strokeStyle": "solid", 15 | "roughness": 2, 16 | "opacity": 100, 17 | "angle": 0, 18 | "x": 720.4444444444445, 19 | "y": 213.33333333333326, 20 | "strokeColor": "#000000", 21 | "backgroundColor": "transparent", 22 | "width": 170.99999999999997, 23 | "height": 99.11111111111126, 24 | "seed": 995042189, 25 | "groupIds": [], 26 | "strokeSharpness": "sharp", 27 | "boundElementIds": [ 28 | "Hkoqt5d0Sl3sXMukZrCR1", 29 | "zt0p_rsTJDNOYfL2kd837", 30 | "t8tMsf-vn2soRdThUzukD", 31 | "GVf-gOcvX1P0di7Wr8fKv", 32 | "p44w1MoYwbs46AGoq9BaF", 33 | "8ajidbF7fyzqr-fTun0KR", 34 | "42NGyYLNkjRb4cV6k8zI4", 35 | "qCNnFidZcXBAp4pUI5hxK", 36 | "CRzm_eN7prP35PH08FA2K", 37 | "VqDfw9oUsK7L58At40UY0", 38 | "YS_E4KPKq5mVlst3qpRYS", 39 | "kSxSXRG_eS7MV3rnxC2Kf", 40 | "jKLc9SoaUy_fgh7W3EhQG" 41 | ] 42 | }, 43 | { 44 | "type": "text", 45 | "version": 141, 46 | "versionNonce": 470647907, 47 | "isDeleted": false, 48 | "id": "PUCEjxoWcElC3EGD4R3Zd", 49 | "fillStyle": "hachure", 50 | "strokeWidth": 1, 51 | "strokeStyle": "solid", 52 | "roughness": 1, 53 | "opacity": 100, 54 | "angle": 0, 55 | "x": 749.4444444444445, 56 | "y": 237.88888888888886, 57 | "strokeColor": "#000000", 58 | "backgroundColor": "transparent", 59 | "width": 113, 60 | "height": 50, 61 | "seed": 1663618563, 62 | "groupIds": [], 63 | "strokeSharpness": "sharp", 64 | "boundElementIds": [], 65 | "fontSize": 20, 66 | "fontFamily": 1, 67 | "text": "WebSockets\nserver", 68 | "baseline": 43, 69 | "textAlign": "center", 70 | "verticalAlign": "middle" 71 | }, 72 | { 73 | "type": "rectangle", 74 | "version": 309, 75 | "versionNonce": 1198114349, 76 | "isDeleted": false, 77 | "id": "tmTc5ipT-DXYSe7vm5pll", 78 | "fillStyle": "hachure", 79 | "strokeWidth": 1, 80 | "strokeStyle": "solid", 81 | "roughness": 2, 82 | "opacity": 100, 83 | "angle": 0, 84 | "x": 509.0000000000001, 85 | "y": 126.33333333333331, 86 | "strokeColor": "#000000", 87 | "backgroundColor": "transparent", 88 | "width": 133.9999999999999, 89 | "height": 81, 90 | "seed": 1780296173, 91 | "groupIds": [], 92 | "strokeSharpness": "sharp", 93 | "boundElementIds": [ 94 | "GVf-gOcvX1P0di7Wr8fKv", 95 | "0Z0mqlPwbcTGZK3bOytff", 96 | "kSxSXRG_eS7MV3rnxC2Kf" 97 | ] 98 | }, 99 | { 100 | "type": "text", 101 | "version": 351, 102 | "versionNonce": 588511245, 103 | "isDeleted": false, 104 | "id": "deDc0fiwlUq1M8OZ6KJUl", 105 | "fillStyle": "hachure", 106 | "strokeWidth": 1, 107 | "strokeStyle": "solid", 108 | "roughness": 1, 109 | "opacity": 100, 110 | "angle": 0, 111 | "x": 524.6111111111111, 112 | "y": 147.38888888888886, 113 | "strokeColor": "#000000", 114 | "backgroundColor": "transparent", 115 | "width": 103, 116 | "height": 38, 117 | "seed": 231934381, 118 | "groupIds": [], 119 | "strokeSharpness": "sharp", 120 | "boundElementIds": [ 121 | "7aq_Yf5rxmhCjEQTcxqps" 122 | ], 123 | "fontSize": 16, 124 | "fontFamily": 3, 125 | "text": "Recv socket\nudp:5000", 126 | "baseline": 34, 127 | "textAlign": "left", 128 | "verticalAlign": "top" 129 | }, 130 | { 131 | "type": "rectangle", 132 | "version": 439, 133 | "versionNonce": 402935203, 134 | "isDeleted": false, 135 | "id": "pj2h07wERfL0YzaTMraNo", 136 | "fillStyle": "hachure", 137 | "strokeWidth": 1, 138 | "strokeStyle": "solid", 139 | "roughness": 2, 140 | "opacity": 100, 141 | "angle": 0, 142 | "x": 187.66666666666669, 143 | "y": 114.49999999999997, 144 | "strokeColor": "#000000", 145 | "backgroundColor": "transparent", 146 | "width": 132.9999999999999, 147 | "height": 81, 148 | "seed": 1228902317, 149 | "groupIds": [], 150 | "strokeSharpness": "sharp", 151 | "boundElementIds": [ 152 | "8ajidbF7fyzqr-fTun0KR", 153 | "NfpmfQY_uOqzpvtdx3uJm", 154 | "6NdDrpV63l1tnM8DmhX_-", 155 | "4CvTrSL3IASt3EOuGQJPm" 156 | ] 157 | }, 158 | { 159 | "type": "text", 160 | "version": 371, 161 | "versionNonce": 1309023139, 162 | "isDeleted": false, 163 | "id": "meaddOY1_gASClZOMiEBT", 164 | "fillStyle": "hachure", 165 | "strokeWidth": 1, 166 | "strokeStyle": "solid", 167 | "roughness": 1, 168 | "opacity": 100, 169 | "angle": 0, 170 | "x": 209.16666666666669, 171 | "y": 130, 172 | "strokeColor": "#000000", 173 | "backgroundColor": "transparent", 174 | "width": 94, 175 | "height": 48, 176 | "seed": 168029539, 177 | "groupIds": [], 178 | "strokeSharpness": "sharp", 179 | "boundElementIds": [ 180 | "T0kTVoKwg7ly8ziDFmSom" 181 | ], 182 | "fontSize": 20, 183 | "fontFamily": 3, 184 | "text": "Socket\nudp:5001", 185 | "baseline": 43, 186 | "textAlign": "center", 187 | "verticalAlign": "top" 188 | }, 189 | { 190 | "type": "rectangle", 191 | "version": 266, 192 | "versionNonce": 1112611651, 193 | "isDeleted": false, 194 | "id": "bC1aLS38pCpjMtywq1Y5r", 195 | "fillStyle": "hachure", 196 | "strokeWidth": 1, 197 | "strokeStyle": "solid", 198 | "roughness": 1, 199 | "opacity": 100, 200 | "angle": 0, 201 | "x": 488, 202 | "y": 71.33333333333331, 203 | "strokeColor": "#000000", 204 | "backgroundColor": "transparent", 205 | "width": 173, 206 | "height": 233.66666666666663, 207 | "seed": 1632321027, 208 | "groupIds": [], 209 | "strokeSharpness": "sharp", 210 | "boundElementIds": [ 211 | "4CvTrSL3IASt3EOuGQJPm", 212 | "tV9kKdNP7QHvUNq2SOkB_" 213 | ] 214 | }, 215 | { 216 | "type": "text", 217 | "version": 149, 218 | "versionNonce": 569538349, 219 | "isDeleted": false, 220 | "id": "y_31uPa3HNhsL16TE3hUK", 221 | "fillStyle": "hachure", 222 | "strokeWidth": 1, 223 | "strokeStyle": "solid", 224 | "roughness": 1, 225 | "opacity": 100, 226 | "angle": 0, 227 | "x": 506, 228 | "y": 90.33333333333331, 229 | "strokeColor": "#000000", 230 | "backgroundColor": "transparent", 231 | "width": 141, 232 | "height": 24, 233 | "seed": 1707358627, 234 | "groupIds": [], 235 | "strokeSharpness": "sharp", 236 | "boundElementIds": [], 237 | "fontSize": 20, 238 | "fontFamily": 3, 239 | "text": "Channel /foo", 240 | "baseline": 19, 241 | "textAlign": "left", 242 | "verticalAlign": "top" 243 | }, 244 | { 245 | "type": "rectangle", 246 | "version": 316, 247 | "versionNonce": 109026093, 248 | "isDeleted": false, 249 | "id": "sMs4ichzZFI_aOw0GFpeI", 250 | "fillStyle": "hachure", 251 | "strokeWidth": 1, 252 | "strokeStyle": "solid", 253 | "roughness": 2, 254 | "opacity": 100, 255 | "angle": 0, 256 | "x": 507.388888888889, 257 | "y": 408.33333333333337, 258 | "strokeColor": "#000000", 259 | "backgroundColor": "transparent", 260 | "width": 133.9999999999999, 261 | "height": 81, 262 | "seed": 1914397773, 263 | "groupIds": [], 264 | "strokeSharpness": "sharp", 265 | "boundElementIds": [ 266 | "CRzm_eN7prP35PH08FA2K", 267 | "jKLc9SoaUy_fgh7W3EhQG" 268 | ] 269 | }, 270 | { 271 | "type": "text", 272 | "version": 356, 273 | "versionNonce": 780394947, 274 | "isDeleted": false, 275 | "id": "MAwQPnxF6WG3N98K7DlFx", 276 | "fillStyle": "hachure", 277 | "strokeWidth": 1, 278 | "strokeStyle": "solid", 279 | "roughness": 1, 280 | "opacity": 100, 281 | "angle": 0, 282 | "x": 521.888888888889, 283 | "y": 429.3888888888889, 284 | "strokeColor": "#000000", 285 | "backgroundColor": "transparent", 286 | "width": 103, 287 | "height": 38, 288 | "seed": 1111500685, 289 | "groupIds": [], 290 | "strokeSharpness": "sharp", 291 | "boundElementIds": [ 292 | "p44w1MoYwbs46AGoq9BaF", 293 | "QeTrPyg2hfB8xNlm-O7XG", 294 | "2pS9kwkeO7FUPqniU_Ar4" 295 | ], 296 | "fontSize": 16, 297 | "fontFamily": 3, 298 | "text": "Recv socket\nudp:6000", 299 | "baseline": 34, 300 | "textAlign": "left", 301 | "verticalAlign": "top" 302 | }, 303 | { 304 | "type": "rectangle", 305 | "version": 511, 306 | "versionNonce": 1706510445, 307 | "isDeleted": false, 308 | "id": "YYlQzs78fECoGO_Pf70mS", 309 | "fillStyle": "hachure", 310 | "strokeWidth": 1, 311 | "strokeStyle": "solid", 312 | "roughness": 2, 313 | "opacity": 100, 314 | "angle": 0, 315 | "x": 186.0555555555555, 316 | "y": 344.83333333333314, 317 | "strokeColor": "#000000", 318 | "backgroundColor": "transparent", 319 | "width": 134.11111111111097, 320 | "height": 81, 321 | "seed": 2047910211, 322 | "groupIds": [], 323 | "strokeSharpness": "sharp", 324 | "boundElementIds": [ 325 | "42NGyYLNkjRb4cV6k8zI4", 326 | "Ck5OJFxYYsn39nTY3rBo8", 327 | "MpZ8d_mZzTY-NbpHP48Ib", 328 | "tV9kKdNP7QHvUNq2SOkB_" 329 | ] 330 | }, 331 | { 332 | "type": "text", 333 | "version": 467, 334 | "versionNonce": 1905468205, 335 | "isDeleted": false, 336 | "id": "TLLyc8-QnhkyVVrMJ5xAA", 337 | "fillStyle": "hachure", 338 | "strokeWidth": 1, 339 | "strokeStyle": "solid", 340 | "roughness": 1, 341 | "opacity": 100, 342 | "angle": 0, 343 | "x": 209.16666666666657, 344 | "y": 360.33333333333314, 345 | "strokeColor": "#000000", 346 | "backgroundColor": "transparent", 347 | "width": 94, 348 | "height": 48, 349 | "seed": 1951247853, 350 | "groupIds": [], 351 | "strokeSharpness": "sharp", 352 | "boundElementIds": [], 353 | "fontSize": 20, 354 | "fontFamily": 3, 355 | "text": "Socket\nudp:5002", 356 | "baseline": 43, 357 | "textAlign": "center", 358 | "verticalAlign": "top" 359 | }, 360 | { 361 | "type": "rectangle", 362 | "version": 202, 363 | "versionNonce": 593480269, 364 | "isDeleted": false, 365 | "id": "CQRGfrETTmWGltMscASJS", 366 | "fillStyle": "hachure", 367 | "strokeWidth": 1, 368 | "strokeStyle": "solid", 369 | "roughness": 1, 370 | "opacity": 100, 371 | "angle": 0, 372 | "x": 486.388888888889, 373 | "y": 353.33333333333337, 374 | "strokeColor": "#000000", 375 | "backgroundColor": "transparent", 376 | "width": 173, 377 | "height": 158.6666666666666, 378 | "seed": 52310883, 379 | "groupIds": [], 380 | "strokeSharpness": "sharp", 381 | "boundElementIds": [] 382 | }, 383 | { 384 | "type": "text", 385 | "version": 163, 386 | "versionNonce": 2117282275, 387 | "isDeleted": false, 388 | "id": "QpOfTA1dauHXjomm6G9V9", 389 | "fillStyle": "hachure", 390 | "strokeWidth": 1, 391 | "strokeStyle": "solid", 392 | "roughness": 1, 393 | "opacity": 100, 394 | "angle": 0, 395 | "x": 504.388888888889, 396 | "y": 371.2222222222222, 397 | "strokeColor": "#000000", 398 | "backgroundColor": "transparent", 399 | "width": 141, 400 | "height": 24, 401 | "seed": 1805346893, 402 | "groupIds": [], 403 | "strokeSharpness": "sharp", 404 | "boundElementIds": [ 405 | "CRzm_eN7prP35PH08FA2K" 406 | ], 407 | "fontSize": 20, 408 | "fontFamily": 3, 409 | "text": "Channel /bar", 410 | "baseline": 19, 411 | "textAlign": "left", 412 | "verticalAlign": "top" 413 | }, 414 | { 415 | "type": "rectangle", 416 | "version": 196, 417 | "versionNonce": 1055586477, 418 | "isDeleted": false, 419 | "id": "3LdPAmAuFC7mAxNLFIrUB", 420 | "fillStyle": "hachure", 421 | "strokeWidth": 1, 422 | "strokeStyle": "solid", 423 | "roughness": 2, 424 | "opacity": 100, 425 | "angle": 0, 426 | "x": 435.8888888888888, 427 | "y": -21.111111111111086, 428 | "strokeColor": "#000000", 429 | "backgroundColor": "transparent", 430 | "width": 499.33333333333337, 431 | "height": 601.1111111111112, 432 | "seed": 365852451, 433 | "groupIds": [], 434 | "strokeSharpness": "sharp", 435 | "boundElementIds": [] 436 | }, 437 | { 438 | "type": "text", 439 | "version": 130, 440 | "versionNonce": 870315171, 441 | "isDeleted": false, 442 | "id": "PrRaQQ-5mIAF2Eq-QoD4T", 443 | "fillStyle": "hachure", 444 | "strokeWidth": 1, 445 | "strokeStyle": "solid", 446 | "roughness": 1, 447 | "opacity": 100, 448 | "angle": 0, 449 | "x": 539.6666666666669, 450 | "y": 6.000000000000059, 451 | "strokeColor": "#000000", 452 | "backgroundColor": "transparent", 453 | "width": 263, 454 | "height": 35, 455 | "seed": 1988133101, 456 | "groupIds": [], 457 | "strokeSharpness": "sharp", 458 | "boundElementIds": [], 459 | "fontSize": 28, 460 | "fontFamily": 1, 461 | "text": "Browserglue Server", 462 | "baseline": 25, 463 | "textAlign": "center", 464 | "verticalAlign": "top" 465 | }, 466 | { 467 | "type": "rectangle", 468 | "version": 324, 469 | "versionNonce": 1908497165, 470 | "isDeleted": false, 471 | "id": "MGcVzaQaBV9Ddy8_Bd4LV", 472 | "fillStyle": "hachure", 473 | "strokeWidth": 1, 474 | "strokeStyle": "solid", 475 | "roughness": 2, 476 | "opacity": 100, 477 | "angle": 0, 478 | "x": 996.8888888888889, 479 | "y": 142.77777777777789, 480 | "strokeColor": "#000000", 481 | "backgroundColor": "transparent", 482 | "width": 236.66666666666677, 483 | "height": 259.99999999999994, 484 | "seed": 1479845613, 485 | "groupIds": [], 486 | "strokeSharpness": "round", 487 | "boundElementIds": [] 488 | }, 489 | { 490 | "type": "text", 491 | "version": 179, 492 | "versionNonce": 165636163, 493 | "isDeleted": false, 494 | "id": "QAkjkxsHjw3FHIIKKFo-j", 495 | "fillStyle": "hachure", 496 | "strokeWidth": 1, 497 | "strokeStyle": "solid", 498 | "roughness": 1, 499 | "opacity": 100, 500 | "angle": 0, 501 | "x": 1059.111111111111, 502 | "y": 167.1111111111112, 503 | "strokeColor": "#000000", 504 | "backgroundColor": "transparent", 505 | "width": 111, 506 | "height": 35, 507 | "seed": 2058504995, 508 | "groupIds": [], 509 | "strokeSharpness": "sharp", 510 | "boundElementIds": [], 511 | "fontSize": 28, 512 | "fontFamily": 1, 513 | "text": "Browser", 514 | "baseline": 25, 515 | "textAlign": "center", 516 | "verticalAlign": "top" 517 | }, 518 | { 519 | "type": "rectangle", 520 | "version": 197, 521 | "versionNonce": 1974337997, 522 | "isDeleted": false, 523 | "id": "lmPV_TgHrJKvKlHiIrGpi", 524 | "fillStyle": "hachure", 525 | "strokeWidth": 1, 526 | "strokeStyle": "solid", 527 | "roughness": 2, 528 | "opacity": 100, 529 | "angle": 0, 530 | "x": 1028.5555555555557, 531 | "y": 232.77777777777783, 532 | "strokeColor": "#000000", 533 | "backgroundColor": "transparent", 534 | "width": 173.33333333333326, 535 | "height": 135, 536 | "seed": 1697132003, 537 | "groupIds": [], 538 | "strokeSharpness": "sharp", 539 | "boundElementIds": [ 540 | "CuNSxX9BsPILqE7j9gwcr", 541 | "VqDfw9oUsK7L58At40UY0", 542 | "YS_E4KPKq5mVlst3qpRYS" 543 | ] 544 | }, 545 | { 546 | "type": "text", 547 | "version": 203, 548 | "versionNonce": 2027338285, 549 | "isDeleted": false, 550 | "id": "0WiN3k2_67vzkoC2hAIdu", 551 | "fillStyle": "hachure", 552 | "strokeWidth": 1, 553 | "strokeStyle": "solid", 554 | "roughness": 1, 555 | "opacity": 100, 556 | "angle": 0, 557 | "x": 1057.2222222222222, 558 | "y": 275.2777777777778, 559 | "strokeColor": "#000000", 560 | "backgroundColor": "transparent", 561 | "width": 116, 562 | "height": 50, 563 | "seed": 547821133, 564 | "groupIds": [], 565 | "strokeSharpness": "sharp", 566 | "boundElementIds": [ 567 | "qCNnFidZcXBAp4pUI5hxK", 568 | "t8tMsf-vn2soRdThUzukD" 569 | ], 570 | "fontSize": 20, 571 | "fontFamily": 1, 572 | "text": "Browserglue\nClient", 573 | "baseline": 43, 574 | "textAlign": "center", 575 | "verticalAlign": "middle" 576 | }, 577 | { 578 | "type": "arrow", 579 | "version": 264, 580 | "versionNonce": 602871011, 581 | "isDeleted": false, 582 | "id": "GVf-gOcvX1P0di7Wr8fKv", 583 | "fillStyle": "hachure", 584 | "strokeWidth": 1, 585 | "strokeStyle": "solid", 586 | "roughness": 1, 587 | "opacity": 100, 588 | "angle": 0, 589 | "x": 649.6031502853319, 590 | "y": 169.4227566910932, 591 | "strokeColor": "#000000", 592 | "backgroundColor": "transparent", 593 | "width": 62.94856297410513, 594 | "height": 34.520948854105, 595 | "seed": 717461997, 596 | "groupIds": [], 597 | "strokeSharpness": "round", 598 | "boundElementIds": [], 599 | "startBinding": { 600 | "elementId": "tmTc5ipT-DXYSe7vm5pll", 601 | "focus": -0.4890360824580015, 602 | "gap": 6.603150285331992 603 | }, 604 | "endBinding": { 605 | "elementId": "HMjyteFfI7ZlyrYywNRD9", 606 | "focus": 0.08013663635176427, 607 | "gap": 9.389627788135073 608 | }, 609 | "points": [ 610 | [ 611 | 0, 612 | 0 613 | ], 614 | [ 615 | 62.94856297410513, 616 | 34.520948854105 617 | ] 618 | ], 619 | "lastCommittedPoint": null, 620 | "startArrowhead": null, 621 | "endArrowhead": "arrow" 622 | }, 623 | { 624 | "type": "rectangle", 625 | "version": 92, 626 | "versionNonce": 1270410381, 627 | "isDeleted": false, 628 | "id": "o5skktmYk5rWB_xePHsBm", 629 | "fillStyle": "hachure", 630 | "strokeWidth": 1, 631 | "strokeStyle": "solid", 632 | "roughness": 2, 633 | "opacity": 100, 634 | "angle": 0, 635 | "x": 511.33333333333326, 636 | "y": 228.3333333333334, 637 | "strokeColor": "#000000", 638 | "backgroundColor": "transparent", 639 | "width": 130, 640 | "height": 58.33333333333336, 641 | "seed": 656626349, 642 | "groupIds": [], 643 | "strokeSharpness": "sharp", 644 | "boundElementIds": [ 645 | "6NdDrpV63l1tnM8DmhX_-", 646 | "MpZ8d_mZzTY-NbpHP48Ib" 647 | ] 648 | }, 649 | { 650 | "type": "text", 651 | "version": 136, 652 | "versionNonce": 436448963, 653 | "isDeleted": false, 654 | "id": "6R8fCShOCpNR3lj38so3Z", 655 | "fillStyle": "hachure", 656 | "strokeWidth": 1, 657 | "strokeStyle": "solid", 658 | "roughness": 1, 659 | "opacity": 100, 660 | "angle": 0, 661 | "x": 524.9999999999998, 662 | "y": 237.44444444444449, 663 | "strokeColor": "#000000", 664 | "backgroundColor": "transparent", 665 | "width": 103, 666 | "height": 38, 667 | "seed": 1797155181, 668 | "groupIds": [], 669 | "strokeSharpness": "sharp", 670 | "boundElementIds": [ 671 | "NfpmfQY_uOqzpvtdx3uJm", 672 | "Ck5OJFxYYsn39nTY3rBo8" 673 | ], 674 | "fontSize": 16, 675 | "fontFamily": 3, 676 | "text": "Subscribers\n5001, 5002", 677 | "baseline": 34, 678 | "textAlign": "left", 679 | "verticalAlign": "top" 680 | }, 681 | { 682 | "type": "rectangle", 683 | "version": 236, 684 | "versionNonce": 826894349, 685 | "isDeleted": false, 686 | "id": "vI9j0_dihPuWb8CGmrpyb", 687 | "fillStyle": "hachure", 688 | "strokeWidth": 1, 689 | "strokeStyle": "solid", 690 | "roughness": 2, 691 | "opacity": 100, 692 | "angle": 0, 693 | "x": 182.3333333333334, 694 | "y": 467.22222222222297, 695 | "strokeColor": "#000000", 696 | "backgroundColor": "transparent", 697 | "width": 160.00000000000003, 698 | "height": 143.33333333333343, 699 | "seed": 1923354573, 700 | "groupIds": [], 701 | "strokeSharpness": "round", 702 | "boundElementIds": [ 703 | "2pS9kwkeO7FUPqniU_Ar4" 704 | ] 705 | }, 706 | { 707 | "type": "text", 708 | "version": 207, 709 | "versionNonce": 737636813, 710 | "isDeleted": false, 711 | "id": "XsUgPPbXfufv23KzVKyS-", 712 | "fillStyle": "hachure", 713 | "strokeWidth": 1, 714 | "strokeStyle": "solid", 715 | "roughness": 1, 716 | "opacity": 100, 717 | "angle": 0, 718 | "x": 204.00000000000006, 719 | "y": 484.8888888888897, 720 | "strokeColor": "#000000", 721 | "backgroundColor": "transparent", 722 | "width": 127, 723 | "height": 100, 724 | "seed": 1742461283, 725 | "groupIds": [], 726 | "strokeSharpness": "sharp", 727 | "boundElementIds": [], 728 | "fontSize": 20, 729 | "fontFamily": 1, 730 | "text": "OSC app #3\n\nOnly sends \nmessages...", 731 | "baseline": 93, 732 | "textAlign": "left", 733 | "verticalAlign": "top" 734 | }, 735 | { 736 | "type": "arrow", 737 | "version": 587, 738 | "versionNonce": 533246307, 739 | "isDeleted": false, 740 | "id": "2pS9kwkeO7FUPqniU_Ar4", 741 | "fillStyle": "hachure", 742 | "strokeWidth": 1, 743 | "strokeStyle": "solid", 744 | "roughness": 1, 745 | "opacity": 100, 746 | "angle": 0, 747 | "x": 352.3333333333335, 748 | "y": 529.7016934401572, 749 | "strokeColor": "#000000", 750 | "backgroundColor": "transparent", 751 | "width": 156.22222222222223, 752 | "height": 62.4031614802218, 753 | "seed": 1442201357, 754 | "groupIds": [], 755 | "strokeSharpness": "round", 756 | "boundElementIds": [], 757 | "startBinding": { 758 | "elementId": "vI9j0_dihPuWb8CGmrpyb", 759 | "gap": 10.000000000000014, 760 | "focus": 0.25523012552301244 761 | }, 762 | "endBinding": { 763 | "elementId": "MAwQPnxF6WG3N98K7DlFx", 764 | "gap": 13.333333333333314, 765 | "focus": 0.1765935214211056 766 | }, 767 | "points": [ 768 | [ 769 | 0, 770 | 0 771 | ], 772 | [ 773 | 156.22222222222223, 774 | -62.4031614802218 775 | ] 776 | ], 777 | "lastCommittedPoint": null, 778 | "startArrowhead": null, 779 | "endArrowhead": "arrow" 780 | }, 781 | { 782 | "type": "rectangle", 783 | "version": 170, 784 | "versionNonce": 949425997, 785 | "isDeleted": false, 786 | "id": "NLZHg4uJq2nhL4pqxQ3er", 787 | "fillStyle": "hachure", 788 | "strokeWidth": 1, 789 | "strokeStyle": "solid", 790 | "roughness": 2, 791 | "opacity": 100, 792 | "angle": 0, 793 | "x": 145.66666666666663, 794 | "y": -35.999999999999936, 795 | "strokeColor": "#000000", 796 | "backgroundColor": "transparent", 797 | "width": 231.66666666666669, 798 | "height": 248.3333333333333, 799 | "seed": 640208045, 800 | "groupIds": [], 801 | "strokeSharpness": "round", 802 | "boundElementIds": [ 803 | "0Z0mqlPwbcTGZK3bOytff" 804 | ] 805 | }, 806 | { 807 | "type": "text", 808 | "version": 195, 809 | "versionNonce": 1064702083, 810 | "isDeleted": false, 811 | "id": "emi9CPh_rowS_sV41E5Z4", 812 | "fillStyle": "hachure", 813 | "strokeWidth": 1, 814 | "strokeStyle": "solid", 815 | "roughness": 1, 816 | "opacity": 100, 817 | "angle": 0, 818 | "x": 165.66666666666663, 819 | "y": -14.999999999999927, 820 | "strokeColor": "#000000", 821 | "backgroundColor": "transparent", 822 | "width": 177, 823 | "height": 100, 824 | "seed": 34349709, 825 | "groupIds": [], 826 | "strokeSharpness": "sharp", 827 | "boundElementIds": [], 828 | "fontSize": 20, 829 | "fontFamily": 1, 830 | "text": "OSC app #1\n\nSneds and \nreceives messages", 831 | "baseline": 93, 832 | "textAlign": "left", 833 | "verticalAlign": "top" 834 | }, 835 | { 836 | "type": "rectangle", 837 | "version": 87, 838 | "versionNonce": 699442605, 839 | "isDeleted": false, 840 | "id": "wzQTNNewYyPKQrjnt_pb2", 841 | "fillStyle": "hachure", 842 | "strokeWidth": 1, 843 | "strokeStyle": "solid", 844 | "roughness": 2, 845 | "opacity": 100, 846 | "angle": 0, 847 | "x": 148.99999999999997, 848 | "y": 227.3333333333333, 849 | "strokeColor": "#000000", 850 | "backgroundColor": "transparent", 851 | "width": 211.66666666666666, 852 | "height": 220.00000000000003, 853 | "seed": 1259033667, 854 | "groupIds": [], 855 | "strokeSharpness": "round", 856 | "boundElementIds": [] 857 | }, 858 | { 859 | "type": "text", 860 | "version": 130, 861 | "versionNonce": 719483299, 862 | "isDeleted": false, 863 | "id": "-fNDnRIqo2yeTAAFIiNZ6", 864 | "fillStyle": "hachure", 865 | "strokeWidth": 1, 866 | "strokeStyle": "solid", 867 | "roughness": 1, 868 | "opacity": 100, 869 | "angle": 0, 870 | "x": 172.88888888888883, 871 | "y": 246.66666666666657, 872 | "strokeColor": "#000000", 873 | "backgroundColor": "transparent", 874 | "width": 128, 875 | "height": 75, 876 | "seed": 2055724739, 877 | "groupIds": [], 878 | "strokeSharpness": "sharp", 879 | "boundElementIds": [], 880 | "fontSize": 20, 881 | "fontFamily": 1, 882 | "text": "OSC app #2\nOnly receives\nmessages", 883 | "baseline": 68, 884 | "textAlign": "left", 885 | "verticalAlign": "top" 886 | }, 887 | { 888 | "type": "arrow", 889 | "version": 81, 890 | "versionNonce": 759957411, 891 | "isDeleted": false, 892 | "id": "0Z0mqlPwbcTGZK3bOytff", 893 | "fillStyle": "hachure", 894 | "strokeWidth": 1, 895 | "strokeStyle": "solid", 896 | "roughness": 1, 897 | "opacity": 100, 898 | "angle": 0, 899 | "x": 382.13492063492055, 900 | "y": 117.48513347829169, 901 | "strokeColor": "#000000", 902 | "backgroundColor": "transparent", 903 | "width": 118.99999999999994, 904 | "height": 42.40408699201009, 905 | "seed": 511532483, 906 | "groupIds": [], 907 | "strokeSharpness": "round", 908 | "boundElementIds": [], 909 | "startBinding": { 910 | "elementId": "NLZHg4uJq2nhL4pqxQ3er", 911 | "focus": -0.08658121622936901, 912 | "gap": 4.801587301587205 913 | }, 914 | "endBinding": { 915 | "elementId": "tmTc5ipT-DXYSe7vm5pll", 916 | "focus": -0.3065352491786444, 917 | "gap": 7.865079365079566 918 | }, 919 | "points": [ 920 | [ 921 | 0, 922 | 0 923 | ], 924 | [ 925 | 118.99999999999994, 926 | 42.40408699201009 927 | ] 928 | ], 929 | "lastCommittedPoint": null, 930 | "startArrowhead": null, 931 | "endArrowhead": "arrow" 932 | }, 933 | { 934 | "type": "arrow", 935 | "version": 92, 936 | "versionNonce": 145930979, 937 | "isDeleted": false, 938 | "id": "4CvTrSL3IASt3EOuGQJPm", 939 | "fillStyle": "hachure", 940 | "strokeWidth": 1, 941 | "strokeStyle": "solid", 942 | "roughness": 1, 943 | "opacity": 100, 944 | "angle": 0, 945 | "x": 477.5109501628115, 946 | "y": 238.82127879551774, 947 | "strokeColor": "#000000", 948 | "backgroundColor": "transparent", 949 | "width": 150.93158508344652, 950 | "height": 73.45452693362898, 951 | "seed": 891319949, 952 | "groupIds": [], 953 | "strokeSharpness": "round", 954 | "boundElementIds": [], 955 | "startBinding": { 956 | "elementId": "bC1aLS38pCpjMtywq1Y5r", 957 | "focus": -0.6153605927530154, 958 | "gap": 10.489049837188475 959 | }, 960 | "endBinding": { 961 | "elementId": "pj2h07wERfL0YzaTMraNo", 962 | "focus": -0.3413853600050164, 963 | "gap": 5.9126984126984325 964 | }, 965 | "points": [ 966 | [ 967 | 0, 968 | 0 969 | ], 970 | [ 971 | -150.93158508344652, 972 | -73.45452693362898 973 | ] 974 | ], 975 | "lastCommittedPoint": null, 976 | "startArrowhead": null, 977 | "endArrowhead": "arrow" 978 | }, 979 | { 980 | "type": "arrow", 981 | "version": 208, 982 | "versionNonce": 1023370883, 983 | "isDeleted": false, 984 | "id": "tV9kKdNP7QHvUNq2SOkB_", 985 | "fillStyle": "hachure", 986 | "strokeWidth": 1, 987 | "strokeStyle": "solid", 988 | "roughness": 1, 989 | "opacity": 100, 990 | "angle": 0, 991 | "x": 481.13492063492055, 992 | "y": 283.14193442259955, 993 | "strokeColor": "#000000", 994 | "backgroundColor": "transparent", 995 | "width": 142.40370271751857, 996 | "height": 63.885309376598514, 997 | "seed": 2082180707, 998 | "groupIds": [], 999 | "strokeSharpness": "round", 1000 | "boundElementIds": [], 1001 | "startBinding": { 1002 | "elementId": "bC1aLS38pCpjMtywq1Y5r", 1003 | "gap": 6.865079365079453, 1004 | "focus": -0.3401045617820754 1005 | }, 1006 | "endBinding": { 1007 | "elementId": "YYlQzs78fECoGO_Pf70mS", 1008 | "gap": 18.56455125073552, 1009 | "focus": 0.0014861910801538115 1010 | }, 1011 | "points": [ 1012 | [ 1013 | 0, 1014 | 0 1015 | ], 1016 | [ 1017 | -142.40370271751857, 1018 | 63.885309376598514 1019 | ] 1020 | ], 1021 | "lastCommittedPoint": null, 1022 | "startArrowhead": null, 1023 | "endArrowhead": "arrow" 1024 | }, 1025 | { 1026 | "type": "rectangle", 1027 | "version": 96, 1028 | "versionNonce": 327247277, 1029 | "isDeleted": false, 1030 | "id": "fPn3S7qX6gpR0TbcnUiU4", 1031 | "fillStyle": "hachure", 1032 | "strokeWidth": 1, 1033 | "strokeStyle": "solid", 1034 | "roughness": 2, 1035 | "opacity": 100, 1036 | "angle": 0, 1037 | "x": 717.8015873015872, 1038 | "y": 385.78571428571445, 1039 | "strokeColor": "#000000", 1040 | "backgroundColor": "transparent", 1041 | "width": 186.66666666666697, 1042 | "height": 115.55555555555566, 1043 | "seed": 635335949, 1044 | "groupIds": [], 1045 | "strokeSharpness": "sharp", 1046 | "boundElementIds": [ 1047 | "CuNSxX9BsPILqE7j9gwcr" 1048 | ] 1049 | }, 1050 | { 1051 | "type": "text", 1052 | "version": 133, 1053 | "versionNonce": 597551939, 1054 | "isDeleted": false, 1055 | "id": "V6QDil-UhyGuloVkqw7q3", 1056 | "fillStyle": "hachure", 1057 | "strokeWidth": 1, 1058 | "strokeStyle": "solid", 1059 | "roughness": 1, 1060 | "opacity": 100, 1061 | "angle": 0, 1062 | "x": 735.968253968254, 1063 | "y": 416.28571428571445, 1064 | "strokeColor": "#000000", 1065 | "backgroundColor": "transparent", 1066 | "width": 151, 1067 | "height": 50, 1068 | "seed": 2014543171, 1069 | "groupIds": [], 1070 | "strokeSharpness": "sharp", 1071 | "boundElementIds": [], 1072 | "fontSize": 20, 1073 | "fontFamily": 1, 1074 | "text": "JSON-RPC API\n(HTTP server)", 1075 | "baseline": 43, 1076 | "textAlign": "center", 1077 | "verticalAlign": "middle" 1078 | }, 1079 | { 1080 | "type": "arrow", 1081 | "version": 137, 1082 | "versionNonce": 290920909, 1083 | "isDeleted": false, 1084 | "id": "CRzm_eN7prP35PH08FA2K", 1085 | "fillStyle": "hachure", 1086 | "strokeWidth": 1, 1087 | "strokeStyle": "solid", 1088 | "roughness": 1, 1089 | "opacity": 100, 1090 | "angle": 0, 1091 | "x": 645.4934954061808, 1092 | "y": 409.641132958957, 1093 | "strokeColor": "#000000", 1094 | "backgroundColor": "transparent", 1095 | "width": 65.14509020855655, 1096 | "height": 108.88832655396101, 1097 | "seed": 661960461, 1098 | "groupIds": [], 1099 | "strokeSharpness": "round", 1100 | "boundElementIds": [], 1101 | "startBinding": { 1102 | "elementId": "QpOfTA1dauHXjomm6G9V9", 1103 | "focus": 1.1123989471155864, 1104 | "gap": 14.418910736734802 1105 | }, 1106 | "endBinding": { 1107 | "elementId": "HMjyteFfI7ZlyrYywNRD9", 1108 | "focus": 0.6309529023161202, 1109 | "gap": 9.805858829707063 1110 | }, 1111 | "points": [ 1112 | [ 1113 | 0, 1114 | 0 1115 | ], 1116 | [ 1117 | 65.14509020855655, 1118 | -108.88832655396101 1119 | ] 1120 | ], 1121 | "lastCommittedPoint": null, 1122 | "startArrowhead": null, 1123 | "endArrowhead": "arrow" 1124 | }, 1125 | { 1126 | "type": "arrow", 1127 | "version": 171, 1128 | "versionNonce": 587343885, 1129 | "isDeleted": false, 1130 | "id": "CuNSxX9BsPILqE7j9gwcr", 1131 | "fillStyle": "hachure", 1132 | "strokeWidth": 1, 1133 | "strokeStyle": "solid", 1134 | "roughness": 1, 1135 | "opacity": 100, 1136 | "angle": 0, 1137 | "x": 1023.3571428571431, 1138 | "y": 360.1079186346517, 1139 | "strokeColor": "#000000", 1140 | "backgroundColor": "transparent", 1141 | "width": 109.99999999999989, 1142 | "height": 57.54172291184568, 1143 | "seed": 355513155, 1144 | "groupIds": [], 1145 | "strokeSharpness": "round", 1146 | "boundElementIds": [], 1147 | "startBinding": { 1148 | "elementId": "lmPV_TgHrJKvKlHiIrGpi", 1149 | "focus": -0.11032181665664563, 1150 | "gap": 5.198412698412426 1151 | }, 1152 | "endBinding": { 1153 | "elementId": "fPn3S7qX6gpR0TbcnUiU4", 1154 | "focus": 0.2585271317829443, 1155 | "gap": 8.888888888888914 1156 | }, 1157 | "points": [ 1158 | [ 1159 | 0, 1160 | 0 1161 | ], 1162 | [ 1163 | -109.99999999999989, 1164 | 57.54172291184568 1165 | ] 1166 | ], 1167 | "lastCommittedPoint": null, 1168 | "startArrowhead": "arrow", 1169 | "endArrowhead": "arrow" 1170 | }, 1171 | { 1172 | "type": "arrow", 1173 | "version": 137, 1174 | "versionNonce": 277925539, 1175 | "isDeleted": false, 1176 | "id": "VqDfw9oUsK7L58At40UY0", 1177 | "fillStyle": "hachure", 1178 | "strokeWidth": 1, 1179 | "strokeStyle": "solid", 1180 | "roughness": 1, 1181 | "opacity": 100, 1182 | "angle": 0, 1183 | "x": 1021.1349206349207, 1184 | "y": 263.65707042474645, 1185 | "strokeColor": "#000000", 1186 | "backgroundColor": "transparent", 1187 | "width": 118.88888888888891, 1188 | "height": 14.749773982011789, 1189 | "seed": 811853101, 1190 | "groupIds": [], 1191 | "strokeSharpness": "round", 1192 | "boundElementIds": [], 1193 | "startBinding": { 1194 | "elementId": "lmPV_TgHrJKvKlHiIrGpi", 1195 | "focus": 0.3188142263929052, 1196 | "gap": 7.420634920634825 1197 | }, 1198 | "endBinding": { 1199 | "elementId": "HMjyteFfI7ZlyrYywNRD9", 1200 | "focus": -0.4309810369944255, 1201 | "gap": 10.801587301587347 1202 | }, 1203 | "points": [ 1204 | [ 1205 | 0, 1206 | 0 1207 | ], 1208 | [ 1209 | -118.88888888888891, 1210 | -14.749773982011789 1211 | ] 1212 | ], 1213 | "lastCommittedPoint": null, 1214 | "startArrowhead": null, 1215 | "endArrowhead": "arrow" 1216 | }, 1217 | { 1218 | "type": "arrow", 1219 | "version": 137, 1220 | "versionNonce": 2024915427, 1221 | "isDeleted": false, 1222 | "id": "YS_E4KPKq5mVlst3qpRYS", 1223 | "fillStyle": "hachure", 1224 | "strokeWidth": 1, 1225 | "strokeStyle": "solid", 1226 | "roughness": 1, 1227 | "opacity": 100, 1228 | "angle": 0, 1229 | "x": 898.9126984126985, 1230 | "y": 278.3882854961922, 1231 | "strokeColor": "#000000", 1232 | "backgroundColor": "transparent", 1233 | "width": 122.22222222222217, 1234 | "height": 14.14727158169876, 1235 | "seed": 1345602541, 1236 | "groupIds": [], 1237 | "strokeSharpness": "round", 1238 | "boundElementIds": [], 1239 | "startBinding": { 1240 | "elementId": "HMjyteFfI7ZlyrYywNRD9", 1241 | "focus": 0.07969902649496549, 1242 | "gap": 7.468253968254089 1243 | }, 1244 | "endBinding": { 1245 | "elementId": "lmPV_TgHrJKvKlHiIrGpi", 1246 | "focus": -0.04060819494903337, 1247 | "gap": 7.420634920634825 1248 | }, 1249 | "points": [ 1250 | [ 1251 | 0, 1252 | 0 1253 | ], 1254 | [ 1255 | 122.22222222222217, 1256 | 14.14727158169876 1257 | ] 1258 | ], 1259 | "lastCommittedPoint": null, 1260 | "startArrowhead": null, 1261 | "endArrowhead": "arrow" 1262 | }, 1263 | { 1264 | "id": "kSxSXRG_eS7MV3rnxC2Kf", 1265 | "type": "arrow", 1266 | "x": 712.6111111111111, 1267 | "y": 232.77777777777823, 1268 | "width": 60, 1269 | "height": 31, 1270 | "angle": 0, 1271 | "strokeColor": "#000000", 1272 | "backgroundColor": "transparent", 1273 | "fillStyle": "hachure", 1274 | "strokeWidth": 1, 1275 | "strokeStyle": "solid", 1276 | "roughness": 1, 1277 | "opacity": 100, 1278 | "groupIds": [], 1279 | "strokeSharpness": "round", 1280 | "seed": 1923473133, 1281 | "version": 34, 1282 | "versionNonce": 1516081763, 1283 | "isDeleted": false, 1284 | "boundElementIds": null, 1285 | "points": [ 1286 | [ 1287 | 0, 1288 | 0 1289 | ], 1290 | [ 1291 | -60, 1292 | -31 1293 | ] 1294 | ], 1295 | "lastCommittedPoint": null, 1296 | "startBinding": { 1297 | "elementId": "HMjyteFfI7ZlyrYywNRD9", 1298 | "focus": -0.19322526153573039, 1299 | "gap": 7.833333333333371 1300 | }, 1301 | "endBinding": { 1302 | "elementId": "tmTc5ipT-DXYSe7vm5pll", 1303 | "focus": -0.06174346078938282, 1304 | "gap": 9.611111111111143 1305 | }, 1306 | "startArrowhead": null, 1307 | "endArrowhead": "arrow" 1308 | }, 1309 | { 1310 | "id": "jKLc9SoaUy_fgh7W3EhQG", 1311 | "type": "arrow", 1312 | "x": 724.0525161847947, 1313 | "y": 322.0236241591892, 1314 | "width": 73.44140507368365, 1315 | "height": 119.75415361858904, 1316 | "angle": 0, 1317 | "strokeColor": "#000000", 1318 | "backgroundColor": "transparent", 1319 | "fillStyle": "hachure", 1320 | "strokeWidth": 1, 1321 | "strokeStyle": "solid", 1322 | "roughness": 1, 1323 | "opacity": 100, 1324 | "groupIds": [], 1325 | "strokeSharpness": "round", 1326 | "seed": 835025229, 1327 | "version": 53, 1328 | "versionNonce": 268042883, 1329 | "isDeleted": false, 1330 | "boundElementIds": null, 1331 | "points": [ 1332 | [ 1333 | 0, 1334 | 0 1335 | ], 1336 | [ 1337 | -73.44140507368365, 1338 | 119.75415361858904 1339 | ] 1340 | ], 1341 | "lastCommittedPoint": null, 1342 | "startBinding": { 1343 | "elementId": "HMjyteFfI7ZlyrYywNRD9", 1344 | "focus": 0.39370220386125143, 1345 | "gap": 9.57917971474464 1346 | }, 1347 | "endBinding": { 1348 | "elementId": "sMs4ichzZFI_aOw0GFpeI", 1349 | "focus": 0.7828543382239379, 1350 | "gap": 9.222222222222229 1351 | }, 1352 | "startArrowhead": null, 1353 | "endArrowhead": "arrow" 1354 | } 1355 | ], 1356 | "appState": { 1357 | "gridSize": null, 1358 | "viewBackgroundColor": "#ffffff" 1359 | } 1360 | } --------------------------------------------------------------------------------