title: Flask-SocketIO Not Working On Apache/WSGI
body: <p>I have used the following example code from <a href="http://blog.miguelgrinberg.com/post/easy-websockets-with-flask-and-gevent/page/4" rel="noreferrer">http://blog.miguelgrinberg.com/post/easy-websockets-with-flask-and-gevent/page/4</a> and this works fine when I run it using the test server e.g. <code>python myapp.py</code> I can connect to it and send messages</p>
  
  <pre><code>from flask import Flask, render_template
  from flask.ext.socketio import SocketIO, emit
  
  app = Flask(__name__)
  app.config['SECRET_KEY'] = 'secret!'
  socketio = SocketIO(app)
  
  @app.route('/')
  def index():
      return render_template('index.html')
  
  @socketio.on('my event', namespace='/test')
  def test_message(message):
      emit('my response', {'data': message['data']})
  
  @socketio.on('my broadcast event', namespace='/test')
  def test_message(message):
      emit('my response', {'data': message['data']}, broadcast=True)
  
  @socketio.on('connect', namespace='/test')
  def test_connect():
      emit('my response', {'data': 'Connected'})
  
  @socketio.on('disconnect', namespace='/test')
  def test_disconnect():
      print('Client disconnected')
  
  if __name__ == '__main__':
      socketio.run(app)
  </code></pre>
  
  <p>The problem is when I move this same code to a server that is using Apache to serve Flask I get errors.</p>
  
  <pre><code>RuntimeError: You need to use a gevent-socketio server.
  </code></pre>
  
  <p>Config file for Apache host is:</p>
  
  <pre><code> WSGIApplicationGroup %{GLOBAL}
   WSGIScriptAlias / /var/www/public/flaskApp/flaskApp.wsgi
  
   &lt;Location /var/www/public/flaskApp/flaskApp/&gt;
      Order allow,deny
      Allow from all
  &lt;/Location&gt;
  </code></pre>
  
  <p>Is it possible to run SocketIO/Flask and have it work through Apache?</p>