Skip to content

Commit

Permalink
Allow SocketIOServer keywords to get passed through
Browse files Browse the repository at this point in the history
Allow keyword passthrough at run()
  • Loading branch information
Shep.Walker committed Mar 21, 2014
1 parent 3c06500 commit 378d75c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions flask_socketio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def send(self, message, json=False, namespace=None, room=None):
if socket.active_ns.get(ns_name):
socket[ns_name].base_send(message, json)

def run(self, app, host=None, port=None):
def run(self, app, host=None, port=None, **kwargs):
if host is None:
host = '127.0.0.1'
if port is None:
Expand All @@ -189,7 +189,10 @@ def run(self, app, host=None, port=None):
port = int(server_name.rsplit(':', 1)[1])
else:
port = 5000
self.server = SocketIOServer((host, port), app.wsgi_app, resource='socket.io')
#Don't allow override of resource, otherwise allow SocketIOServer kwargs to be passed through
if 'resource' in kwargs:
kwargs.pop['resource']
self.server = SocketIOServer((host, port), app.wsgi_app, resource='socket.io', **kwargs)
if app.debug:
@run_with_reloader
def run_server():
Expand Down

0 comments on commit 378d75c

Please sign in to comment.