{"action":"created","issue":{"url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/309","repository_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO","labels_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/309/labels{/name}","comments_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/309/comments","events_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/309/events","html_url":"https://github.com/miguelgrinberg/Flask-SocketIO/issues/309","id":171778236,"number":309,"title":"run with SubdomainDispatcher ","user":{"login":"j-walker23","id":2018885,"avatar_url":"https://avatars.githubusercontent.com/u/2018885?v=3","gravatar_id":"","url":"https://api.github.com/users/j-walker23","html_url":"https://github.com/j-walker23","followers_url":"https://api.github.com/users/j-walker23/followers","following_url":"https://api.github.com/users/j-walker23/following{/other_user}","gists_url":"https://api.github.com/users/j-walker23/gists{/gist_id}","starred_url":"https://api.github.com/users/j-walker23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j-walker23/subscriptions","organizations_url":"https://api.github.com/users/j-walker23/orgs","repos_url":"https://api.github.com/users/j-walker23/repos","events_url":"https://api.github.com/users/j-walker23/events{/privacy}","received_events_url":"https://api.github.com/users/j-walker23/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-08-17T22:43:01Z","updated_at":"2016-08-18T01:17:08Z","closed_at":null,"body":"Hey, wondering if there is a way to run flask-socketio with the flask SubdomainDispatcher. Code from http://flask.pocoo.org/docs/0.11/patterns/appdispatch/#dispatch-by-subdomain\r\n\r\nThe way i am running it now\r\n\r\n```\r\ndef make_app(sub):\r\n  if sub == 'admin':\r\n     return admin.create_app()\r\n  return web.create_app()\r\n\r\napp = SubdomainDispatcher('domain.com', make_app)  # type: Flask\r\n\r\nif __name__ == '__main__':\r\n  run_simple('0.0.0.0', 8070, app,\r\n    use_reloader=True, use_debugger=True, use_evalex=False)\r\n```\r\n\r\nI can't figure out how to make socketio.run(app) work since i don't new up the app like the normal `app.run()` method."},"comment":{"url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/comments/240597197","html_url":"https://github.com/miguelgrinberg/Flask-SocketIO/issues/309#issuecomment-240597197","issue_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/309","id":240597197,"user":{"login":"j-walker23","id":2018885,"avatar_url":"https://avatars.githubusercontent.com/u/2018885?v=3","gravatar_id":"","url":"https://api.github.com/users/j-walker23","html_url":"https://github.com/j-walker23","followers_url":"https://api.github.com/users/j-walker23/followers","following_url":"https://api.github.com/users/j-walker23/following{/other_user}","gists_url":"https://api.github.com/users/j-walker23/gists{/gist_id}","starred_url":"https://api.github.com/users/j-walker23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j-walker23/subscriptions","organizations_url":"https://api.github.com/users/j-walker23/orgs","repos_url":"https://api.github.com/users/j-walker23/repos","events_url":"https://api.github.com/users/j-walker23/events{/privacy}","received_events_url":"https://api.github.com/users/j-walker23/received_events","type":"User","site_admin":false},"created_at":"2016-08-18T01:17:08Z","updated_at":"2016-08-18T01:17:08Z","body":"Nice, thank you for explaining that. I think i understand what you are saying, i hope i can explain my issue.\r\n\r\nI am using `eventlet`. And i thought that `if` section of the `socketio.run` method needed `self.server` setup, which happens in the `init_app`.\r\n\r\nBut the `create_app` of the subdomain middleware doesn't get called until the first request comes through. \r\n\r\nI think that was my ultimate problem after digging the other day. I couldn't figure out how to run the socketio server, without first calling `create_app`/`init_app`. And since i don't call `create_app` during startup i was in a infinite circular logic problem lol"}}
{"actor":{"display_login":"j-walker23"}}