Problems with websocket_messaging

38 views
Skip to first unread message

Ali Mhrez

unread,
Jul 7, 2019, 4:26:48 PM7/7/19
to web2py-users
I followed the video of Mr Bruno Rocha to implement simple websocket, the controller is very simple:
@auth.requires_login()
def index():
    form = SQLFORM(Post, formstyle='divs')
    if form.process().accepted:
        websocket_send('http://127.0.0.1:8888', 'hello', 'mykey', 'mygroup')
        pass
    messages = db(Post).select(orderby=~Post.created_on)
    return dict(form=form, messages=messages)

and in the view:
<script>
   $(document).ready(function(){
      if(!$.web2py.web2py_websocket('ws://127.0.0.1:8888/realtime/mygroup', function(e){alert(e.data)}))

         alert("html5 websocket not supported by your browser, try Google Chrome");
   });
   </script>

but when i open the view the server prints exceptions showed in the error_log file.
Any Help Please??
error_log.txt
Reply all
Reply to author
Forward
0 new messages