title: Chatting app on flask(one to one implementation)
body: <p>I am trying to build a flask app in which users can chat in group as well as each other. in order to implement this i am using flaskSocketio. I am able to broadcast my message but how can i do one to one chat....between different users
  I have database of users registered to me.......</p>
  
  <pre><code>@app.route("/chat/")
  def chatting():
   return render_template('chatHome.html')
  
  
  @socketio.on('message')
  def handleMessage(msg):
   send(msg, broadcast=True, include_self=False)
  
  
  if __name__ == '__main__':
  socketio.run(app, host='0.0.0.0', port=(int)(os.environ.get('PORT', 7001)), 
                    debug=True)
  
  
  &lt;script type="text/javascript"&gt;
  $(document).ready(function() {
  var socket = io.connect();
  socket.on('message', function(msg) {
      $("#messages").append('&lt;p style="padding: 10px; background-color: hotpink; 
      overflow: auto;"&gt;'+msg+'&lt;/p&gt;');
      console.log('Received message');
  });
  $('#sendbutton').on('click', function() {
      socket.send($('#myMessage').val());
      $("#rightsend").append('&lt;p style="padding: 10px; background-color: 
  #2aabd2;  overflow: auto;"&gt;'+($('#myMessage').val())+'&lt;/p&gt;');
      $('#myMessage').val('');
  });
  
  $("#myMessage").keyup(function(event){
  if(event.keyCode == 13){
      $("#sendbutton").click();
  }
  });
  
  });
  &lt;/script&gt;
  </code></pre>