npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rudeplay

v0.1.2

Published

Yet another node.js airplay server

Downloads

21

Readme

Rudeplay

Yet another node.js rtsp/airtunes/airplay server.

What is this?

This server is meant to receive audio/video coming from Apple devices, or other emulated Airplay clients. It'll play any received audio data through the speaker module.

What is AirPlay?

At first, Apple created AirTunes, a server meant to receive and play back audio data. This was actually just a special kind of RTSP server, but only devices with the required key could talk to it.

That key has since been found.

AirPlay was the next version of this server, and now supported pictures, videos and screen mirroring.

For now, only audio is working.

Requirements

You will need to install these system dependencies, on ubuntu/debian you will need to do this:

sudo apt-get install libavahi-compat-libdnssd-dev libasound2-dev

Using it

There aren't that many options for now, but starting a server is very easy:

var Rudeplay = require('rudeplay');

var options = {

	// Defaults to 'Rudeplay Server'
	name    : 'My Airplay Server',

	// Defaults to 1.0.0
	version : '1.0.0',

	// Defaults to 5000
	port    : 5000,

	// Defaults to a random mac address
	mac     : '4e:f8:ce:31:3b:21',

	// Maximum time allowed to wait for a retransmit
	// Fastest I've seen was 2ms, slowest +/400
	// Sometimes, it doesn't come at all.
	retransmit_timeout : 100
};

var server = new Rudeplay();

Retransmits

The reason RAOP/Airtunes/Airplay/... is so fast, is because it uses UDP packets to send audio data. UDP is a connection-less protocol. It just sends the packet, but doesn't know (or care) if it arrives.

That's why the data packets Airplay clients send start with a sequence number. If something doesn't seem to arrive, an Airplay server creates a "retransmit" request for that packet and waits for it.

This can be why Airplay sometimes "drops out" now and again: too much data getting lost and/or too much waiting for retransmitted packages.

Retransmits are normally quite fast: the server can create a request, send it out, and receive a response in 2ms (that's the fastest I've seen so far)

But sometimes it takes a lot longer than that. And sometimes, it just doesn't come at all.

In rudeplay you can set the retransmit timeout, so that it doesn't wait too long for packets and cause more dropouts. It's set at 100ms by default, you can lower it if you don't mind to miss some data. You'll hardly notice a single packet going missing, anyway.