Remember Winamp? nixamp is the Napster part now
nixamp shipped this morning as a Winamp shaped player for a terminal. It played your files and drew a spectrum analyser out of block characters. By this evening it does the other half of 1999: your library is a stream other people can find, and once enough of them are listening, they pay to keep listening.
A directory, not a URL you have to hand out
nixamp serve ~/Music already turned a machine into a server. The missing piece was discovery, so there is a public one at nixamp.com/directory. The PWA has a Browse button next to the address field, and picking a stream takes no typing.
Listing is asked for, never assumed. The prompt shows the exact link it is about to publish and defaults to yes, and a terminal that cannot ask a question never publishes at all, because nobody being there to answer is not consent. Loopback and link local addresses are refused, since an entry only its publisher can open is not an entry.
The registry is in memory with heartbeats and a TTL. A restart costs one heartbeat instead of a migration, and a stream that dies falls out of the list without anyone noticing it went.
Publishing the link would have handed strangers the controls
One key used to guard both listening and /api/command. Publishing that to a directory would have let anyone pause your music or point your machine at a different source.
A server mints two keys now. The share link drives the player. The listen key hears it and gets a 403 from /api/command and /api/source. Only the listen key is ever published.
Past five listeners, a dollar buys a day
NIXAMP_PAY_TO=0xYourAddress COINPAY_X402_KEY=cp_live_… nixamp serve ~/Music --x402
Under five concurrent listeners it is free. The sixth gets a 402 with an x402 offer, and one dollar in USDC buys a day. @profullstack/x402-gateway does the protocol and nixamp decides who is charged.
Three choices in there that are not obvious. The count is of live listeners, so a stream quietens back to free on its own. Only the audio is gated, because a 402 on /api/state would break the page that has to render the offer. And nobody is cut off mid track: the gate is asked once, when a request arrives.
The gateway sells crawl access by default and says so, telling the caller that payment is required for training crawlers. Someone trying to hear a song is not a crawler, so that one sentence is replaced on the way out. The offer itself is untouched.
It takes RTMP in and sends RTMP out
--rtmp-in 1935 and OBS or ffmpeg publishes straight to it, with ffmpeg doing the listening via -rtmp_listen, so this costs no dependency and no protocol implementation. Browsers cannot speak RTMP at all, so there are also two HTTP ingest paths, and all three write into the same ffmpeg. One publisher at a time, and a second is refused with 409 rather than mixed in.
Going out, --rtmp youtube=<key> --rtmp x=<key> fans one encode to many destinations through the tee muxer. An ffmpeg per destination is the obvious shape and it encodes the same frames four times. Every output carries onfail=ignore, or one expired key takes the whole broadcast down with it.
Whose server is it
You can administer a server two ways: you hold its control link, or you own it. nixamp login then nixamp serve claims the server for that account, and you can then administer it from a phone anywhere.
The server holds no part of nixamp.com's secret and should not try to validate its tokens. It asks nixamp.com whose a token is and compares that to the owner it recorded at startup. Identity is delegated, authorisation stays local, and that is what lets a laptop trust an account it has never seen. When nixamp.com is unreachable, nobody is the owner rather than everybody, and the control link is the way in until it can be asked again.
Signing in is email and password on all four surfaces, with no magic link, because a link in an inbox is no use on a television.
nixamp is 0.2.0, installable in one line, and the source is at github.com/profullstack/nixamp.
Top comments (0)