Commits

Jeffrey Gelens committed dcb8dd1

usability fixes

  • Participants
  • Parent commits 273af74

Comments (0)

Files changed (3)

File examples/chat/chat.py

 
 WebSocketServer(
     ('0.0.0.0', 8000),
+
     Resource({
         '^/chat': ChatApplication,
         '^/.*': DebuggedApplication(flask_app)
     }),
+
     debug=False
 ).serve_forever()

File examples/chat/templates/index.html

                 }));
             }, 2000);
 
+            $('.message').keypress(function(e) {
+                if (e.which === 13) {
+                    $('.send_message').click();
+                }
+            });
+
             $('.send_message').click(function() {
                 ws.send(JSON.stringify({
                     msg_type: 'message',

File examples/plot_graph.html

 	var iets = "";
 	window.onload = function() {
 		var data = {};
-        var s = new WebSocket("ws://localhost:8000/data");
+        var s = new WebSocket("ws://" + window.location.hostname + ":8000/data");
 
 		s.onopen = function() {
 			s.send('hi');