flasklocalhostosx-yosemiteairplay

AirPlay messes up localhost


Since the last OSX update (Yosemite), my localhost server is full of error messages from airplay (but I am not using it). Each times it's the same:

[31/Oct/2014 05:40:42] code 400, message Bad request version ('RTSP/1.0')
[31/Oct/2014 05:40:42] "GET /info?txtAirPlay&txtRAOP RTSP/1.0" 400 -

It's just annoying to have its server full of error messages so if anyone has a clue to fix that or to remove airplay, I would be very thankful :)


Solution

  • I think I found the answer: On a cisco discovery forum they listed an nmap output that revealed the Yosemite discoveryd port ranges. Turns out the Apple is using port 5000:

    PORT      STATE SERVICE    VERSION
    3689/tcp  open  daap       Apple iTunes DAAP 11.0.1d1
    5000/tcp  open  rtsp       Apple AirTunes rtspd 160.10 (Apple TV)
    7000/tcp  open  http       Apple AirPlay httpd
    7100/tcp  open  http       Apple AirPlay httpd
    62078/tcp open  tcpwrapped
    5353/udp  open  mdns       DNS-based service discovery
    

    As you can imagine this is the default Flask port, just change your running port to anything other than 5000, and this problem should disappear. This Flask extension https://github.com/miguelgrinberg/Flask-Runner can make your life much easier than hard coding the port in the run command.