title: Instant messaging with Flask-socketIO
body: <p>I want to implement an instant messaging server using Flask + Flask-soketIO.
  with client side on mobile phone (front in Ionic 2)<br><br>
  I have already tried different chat room examples with socketIO but I wonder how to manage multiple users chatting two by two.<br></p>
  
  <p>I'm not yet familiar with instant messaging architectures. I have several questions on the subject : </p>
  
  <ul>
  <li>first of all, is Flask a good framework to implement instant messaging for mobile phone application ?<br>
  <em>I did start with Flask because it seems powerful and not heavy as django can be.</em></li>
  <li>In instant messaging app with sokcetIO, how can I connect users two by two?<br>
  I tried this code, but it works for multiple users in the same tchat room : <br></li>
  </ul>
  
  <p>On the client side : </p>
  
  <pre><code>    &lt;script type="text/javascript"&gt;
          $(document).ready(function() {
              var socket = io.connect("http://127.0.0.1:5000");
              socket.on('connect', function() {
                   console.log('connected')
              });
              socket.on('message',function(msg){
                  $("#messages").append('&lt;li&gt;' + msg + '&lt;/li&gt;');
              });
              $("#sendButton").on('click', function() {
                  console.log($('#myMessage').val());
                  socket.send({ 'author': 'Kidz55',
                                'message': $('#myMessage').val()});
                  $('#myMessage').val('');
              });
          });
      &lt;/script&gt;
  </code></pre>
  
  <p>On the server side :<br></p>
  
  <pre><code>@socketio.on('message')
  def handle_json(json):
      print('received json: ' + str(json))
      # broadcasting to everyone who 's connected
      send(json,,broadcast=True)
  </code></pre>
  
  <ul>
  <li>Is it scalable, and does it support heavy traffic ? </li>
  </ul>