openairplay / node_airtunes

node.js AirTunes v2 implementation: stream wirelessly to Apple audio devices.
BSD 2-Clause "Simplified" License
273 stars 84 forks source link

AppleTV2 Gives error "406 Not Acceptable" #20

Closed colinthesealion closed 10 years ago

colinthesealion commented 10 years ago

I've been successful at connecting to both my Airport Express and Airfoil Speakers, but when I try to connect to my AppleTV2 I get error "Not Acceptable", which I presume is HTTP error code 406.

colinthesealion commented 10 years ago

I would guess this is probably related to the similar problem faced by airfoil: http://weblog.rogueamoeba.com/2013/09/25/airfoil-for-mac-4-8-1-restores-appletv-compatibility/. I've contacted them as well to see if they'll share the workaround.

colinthesealion commented 10 years ago

Well I used tcpdump to sniff the packets being sent by airfoil, and it seems that all they did to enable streaming to the apple tv is to remove the encryption.

I have made some changes to my local copy of rtsp.js to conditionally include rsaaeskey and aesiv in the ANNOUNCE request based on an additional option for the airtunes.add method. And I can now send audio to the apple tv by using { encrypted: false }.

I'd be happy to integrate my changes into the main branch if you're interested.

lperrin commented 10 years ago

Hey, thanks for testing this. I'd be happy to merge any changes you make.