AirPlay messes up localhost AirPlay messes up localhost flask flask

AirPlay messes up localhost


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    VERSION3689/tcp  open  daap       Apple iTunes DAAP 11.0.1d15000/tcp  open  rtsp       Apple AirTunes rtspd 160.10 (Apple TV)7000/tcp  open  http       Apple AirPlay httpd7100/tcp  open  http       Apple AirPlay httpd62078/tcp open  tcpwrapped5353/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.


Also, under Flask.run() is the port arg so you can specify which port you'd like to use, this does work for localhost.

Here is the source documentation.

Example:

from flask import Flask, Responseapp = Flask(__name__)@app.route('/')def default():    return Response(status=200)if __name__ == '__main__':    app.run(debug=True, port=12345)


I ran into this same problem, but it turned out that I had an error in my code. I was attempting to connect to a Redis server with the wrong port number and somehow that Airplay error appeared.

I'm not sure if this fixes your problem but it may help someone else encountering the same issue as I had.