Skip to content

--interface: bind the inbound WebSocket listener and mDNS to one interface #36

Closed

Description

@balloobbot

From the daemon-parity audit against the Python sendspin-cli: there is no way to keep this player off a WAN-facing interface. Python's --interface binds the inbound listener on one address and restricts the mDNS advertisement to it (daemon.py, aiosendspin/client/listener.py); the C++ CLI has neither half. Security-relevant, and not on the roadmap yet.

Blocked on sendspin-cpp

The meaningful half — binding the WebSocket listener — needs an upstream change. The library hardcodes the bind address in src/host/ws_server.cpp:

this->server_ = std::make_unique<ix::WebSocketServer>(
    this->server_port_, "0.0.0.0", ix::SocketServer::kDefaultTcpBacklog, ...);

and SendspinClientConfig has no bind-address field, so the CLI cannot express the request at all. The upstream shape would be a bind_address (or similar) on the config, threaded through ConnectionManager to SendspinWsServer — small, host-only. After that lands and a tag is cut, this joins ROADMAP item 17 in wanting a SENDSPIN_GIT_TAG bump.

The local half

Restricting the mDNS advertisement is doable in this repo alone: src/mdns_dnssd.cpp registers with kDNSServiceInterfaceIndexAny, and DNSServiceRegister takes an interface index (if_nametoindex()). Deliberately not shipped on its own — an advertisement scoped to one interface while the socket still listens on 0.0.0.0 hides the player without protecting it, which reads as more security than it is.

Sketch of the flag

--interface <name> (config key interface), long-only like the other non-squeezelite flags. Resolve the name to an address/index at startup and refuse to start on an interface that does not exist, matching the parse-hard-fail convention. Applies to the inbound listener and the advertisement; an outbound -s dial is routed by the kernel and is out of scope, as it is in Python.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions