Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Choose a protocol

Each service names a protocol, so a hub knows whether it can use it. Use a registered name when one fits; the libraries type them, so a typo does not compile.

You offer…ProtocolEndpoint exampleRustyFunPlayer does
The OpenFunscripter WebSocket API (media + scripts)ofs-wsws://127.0.0.1:8080/ofsAdds an OFS source and follows your playback.
OFS API plus device state and range editsofs-ws-extended and ofs-ws, same endpointws://127.0.0.1:8080/ofsSame, and reports its devices to you. See the guide.
A Buttplug server (like Intiface)buttplug-wsws://127.0.0.1:12345Adds a Buttplug output.
VLC’s HTTP interfacevlc-httphttp://127.0.0.1:8080Adds a VLC source.
MPC-HC / MPC-BE web interfacempc-httphttp://127.0.0.1:13579Adds an MPC source.
mpv’s JSON IPC socketmpv-ipcunix://127.0.0.1/run/user/1000/mpv.sockAdds an mpv source.
A game that calls an EDI serveredihttp://127.0.0.1:5000/Serves EDI for the game. See the guide.
A TCode device on a serial porttcode-serialserial://127.0.0.1/dev/ttyACM0Adds a serial output.
A TCode device over WebSocket, TCP or UDPtcode-ws, tcode-tcp, tcode-udpws://127.0.0.1:8000/wsRegistered; not offered by RustyFunPlayer yet.
Whirligig’s timecode serverwhirligig-tcptcp://127.0.0.1:2000Registered; not offered by RustyFunPlayer yet.

Endpoints must be absolute URLs on a loopback host (127.0.0.0/8 or [::1]), with a scheme that matches the protocol. The full table with schemes is in the specification.

Features

A service may list up to 16 features, short strings for optional capabilities a hub can check. Unknown features are ignored.

Your own protocol

If nothing fits, name it explicitly. The name becomes x-<vendor>-<name>; peers refuse any other unregistered name.

import { customProtocol } from "funlink";
const sync = customProtocol("acme", "sync-ws");   // "x-acme-sync-ws"
#![allow(unused)]
fn main() {
let sync = funlink::Protocol::custom("acme", "sync-ws")?;   // x-acme-sync-ws
}
var sync = Protocol.Custom("acme", "sync-ws");   // x-acme-sync-ws
var sync = Protocol.custom("acme", "sync-ws");   // x-acme-sync-ws
// x-acme-sync-ws at ws://0.0.0.0:9000/sync; unregistered protocols name their scheme.
funlink.addService("x-acme-sync-ws", 9000, "/sync", nullptr, "ws");
funlink.services = [{"protocol": "x-acme-sync-ws", "endpoint": "ws://127.0.0.1:9000/sync"}]

Want a name registered? Open an issue with a short description and a link to the protocol’s documentation.