Skip to content

Commit

Permalink
Fix 'path' or 'resource' doesn't work.
Browse files Browse the repository at this point in the history
In this case, it works well:
> socketio = SockeIO(app, path='/path/socket.io')
While this case, it doesn't worked before the change:
> socketio = SockeIO(path='/path/socket.io')
> socketio.init_app(app)
So that this change can fix it.
  • Loading branch information
zhengxiaoyao0716 committed Apr 23, 2017
1 parent a976730 commit a1d7719
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion flask_socketio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ def loads(*args, **kwargs):

self.server_options['json'] = FlaskSafeJSON

resource = kwargs.pop('path', kwargs.pop('resource', 'socket.io'))
# resource = kwargs.pop('path', kwargs.pop('resource', 'socket.io'))
resource = kwargs.pop('path', kwargs.pop('resource', '')) \
or self.server_options.get('path', self.server_options.get('resource')) \
or 'socket.io'
if resource.startswith('/'):
resource = resource[1:]
self.server = socketio.Server(**self.server_options)
Expand Down

0 comments on commit a1d7719

Please sign in to comment.