Git Product home page Git Product logo

airplay-server's Introduction

airplay-server

An extendable and thin AirPlay server.

This module is a thin AirPlay server that you can use to easily implement your own AirPlay functionality. By it self it doesn't do anything else than expose it self on the network as an AirPlay server. All requests to the server is sent to listeners that you attach to the airplay server by listening for the "request" event.

You can see a very simple implementation example under examples/server.js.

I'm currently working on a more full fleshed and usable AirPlay server implementation in the AirServer project, but it's currently a work in progress.

Please note that some AirPlay clients expects a RAOP server (AirTunes) to be running on the network with the same name as the AirPlay server. In case you need a RAOP server, please consider the raop-server project.

Build status js-standard-style

Installation

npm install airplay-server --save

Example usage

var airplay = require('airplay-server')('My AirPlay Server')

airplay.on('request', function (req, res) {
  // do your stuff
})

airplay.listen(5000) // start server on port 5000

API

Constructor

Get the constructor by requireing the airplay-server node module and call it. It takes the optional arguments name, options and onRequest. Either of them can be left out, so calling with only options or only name and onRequest is ok:

require('airplay-server')(name, options, onRequest)

Constructor arguments:

  • name - name of the AirPlay server (default: 'Node.js')
  • options - options object (default: {})
  • onRequest - callback function called upon each request (default: No listener is added. Remember to manually listen on the request event)

Options:

  • features - A features bit-mask (default: all features)
  • txt - object used to replace stock TXT record

Server

The constructor returns a basic Node.js HTTP server, so remember to call .listen() and optionally add a request event listener if one hasn't been provided as an argument to the constructor.

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.