Socket
Socket
Sign inDemoInstall

aircat

Package Overview
Dependencies
38
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

69

index.js
#!/usr/bin/env node
'use strict'
var airplay = require('airplay-server')
var raop = require('raop-stub')
var patterns = require('patterns')()
var plist = require('plist')
var airplay = require('airplay-photos')('aircat')
patterns.add('PUT /photo', photo)
// This endpoint is used for video, but the iPhone will try and connect in case
// the user wants to use the video features
patterns.add('GET /server-info', serverInfo)
// The RAOP server needs to be running for the iPhone to accept this server as
// valid
raop('aircat', function (err) {
if (err) throw err
})
var server = airplay('aircat', function (req, res) {
var match = patterns.match(req.method + ' ' + req.url)
if (!match) {
res.writeHead(404)
res.end()
return
}
var fn = match.value
req.params = match.params
fn(req, res)
})
var airplayTxt
server.on('txt', function (txt) {
airplayTxt = txt
})
server.listen(7000)
function serverInfo (req, res) {
var txt = airplayTxt
var opts = {
deviceid: txt.deviceid,
features: 268438015,
vv: '1',
rhd: '1.06.5',
pw: '0',
srcvers: '150.33',
rmodel: 'MacBookair4,2',
model: 'AppleTV3,1',
protovers: '1.0'
}
var body = plist.build(opts)
res.setHeader('Content-Type', 'text/x-apple-plist+xml')
res.setHeader('Content-Length', body.length)
res.end(body)
}
function photo (req, res) {
airplay.on('photo', function (req) {
req.pipe(process.stdout)
req.on('end', function () {
server.unref()
process.exit() // the mDNS server is holding up the event loop - for now just force exit
airplay.unref()
process.exit() // the mDNS servers are holding up the event loop - for now just force exit
})
}
})

11

package.json
{
"name": "aircat",
"version": "1.0.0",
"version": "1.0.1",
"description": "AirPlay cat tool",

@@ -11,6 +11,3 @@ "main": "index.js",

"dependencies": {
"airplay-server": "^1.1.0",
"patterns": "^1.0.2",
"plist": "^1.1.0",
"raop-stub": "^1.0.1"
"airplay-photos": "^1.0.0"
},

@@ -43,5 +40,5 @@ "devDependencies": {

"coordinates": [
56.1460465,
10.202726
52.2491754,
-7.0604458
]
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc