Skip to content

Commit

Permalink
Added an optional IPv6 support in eventlet
Browse files Browse the repository at this point in the history
  • Loading branch information
riarheos authored and miguelgrinberg committed Apr 27, 2017
1 parent 31e06d4 commit d050d68
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion flask_socketio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,11 @@ def run(self, app, host=None, port=None, **kwargs):
def run_server():
import eventlet
import eventlet.wsgi
eventlet_socket = eventlet.listen((host, port))
import eventlet.green
addresses = eventlet.green.socket.getaddrinfo(host, port)
if not addresses:
raise RuntimeError('Could not resolve host to a valid address')
eventlet_socket = eventlet.listen(addresses[0][4], addresses[0][0])

# If provided an SSL argument, use an SSL socket
ssl_args = ['keyfile', 'certfile', 'server_side', 'cert_reqs',
Expand Down

0 comments on commit d050d68

Please sign in to comment.