Test your integration
Against RustyFunPlayer
- Install and start RustyFunPlayer and leave Settings → Funlink → Offer to connect running apps on.
- Start your app.
- Within 5 seconds a card appears: Your App is running. Connect to follow its playback? (the wording depends on the protocol).
- Click Connect. Your app’s state turns
connected.
No card?
| Check | Fix |
|---|---|
| Your service’s protocol | RustyFunPlayer offers only the protocols marked in Choose a protocol. Others answer unsupported. |
| A source is already playing | Hubs do not prompt while connected to a source. Disconnect it, or use Always connect. |
| You answered Never for this app earlier | Remove it under Settings → Funlink → Never ask again. |
| The announcement is rejected | Read the error body; see Errors. The libraries reject invalid records before sending. |
| You announce from a browser page | RustyFunPlayer refuses web pages. Announce from Node.js, Electron’s main process or a native app. |
On the local network
- In RustyFunPlayer, turn on Settings → Funlink → Find apps and devices on the local network.
- Let the firewall of the computer running RustyFunPlayer accept UDP ports 37420 and 5353. On NixOS, set
programs.rustyfunplayer.funlinkLan.openFirewall = true. - Start your app or device on another machine of the same network. The card names its address.
No card? Settings → Doctor shows whether RustyFunPlayer listens on the local network and how many apps and devices it hears. Wi-Fi access points with client isolation and guest networks drop multicast; enter the device’s address under Also ask these addresses instead. avahi-browse -rt _funlink._udp lists peers that announce over DNS-SD.
Without any hub
Run a hub of your own in a test and check that it finds your app. Set FUNLINK_PORT so tests do not meet a real hub on 37420–37429:
FUNLINK_PORT=37491 npm test
With FUNLINK_PORT set, hubs bind and peers send to that single port only. Java also reads the system property funlink.port.
A minimal TypeScript test:
import { announce, startHub } from "funlink";
process.env.FUNLINK_PORT = "37491";
const found = new Promise((resolve) => {
void startHub({ name: "Test hub", supports: ["ofs-ws"],
onEvent: (e) => e.type === "found" && resolve(e.peer) });
});
const peer = announce({ id: "test", name: "Test",
services: [{ protocol: "ofs-ws", endpoint: "ws://127.0.0.1:8080/ofs" }] });
console.log(await found);
await peer.close();
By hand
See what a hub answers with curl:
curl -sS -X POST http://127.0.0.1:37420/funlink/v1/announce \
-H 'Content-Type: application/json' \
-d '{"id":"test","session":"abcdefgh","name":"Test","services":[{"protocol":"ofs-ws","endpoint":"ws://127.0.0.1:8080/ofs"}]}'
A 200 answer names the hub, the protocols it supports and your state. Try ports 37421 and up if another program holds 37420.
Once it works, add the badge to your app’s page.