/controllers/tv.py
def index():
return dict()
-----------------------------------------
/controllers/client.py
from gluon.contrib.websocket_messaging import websocket_send
def index():
m1=websocket_send('
http://127.0.0.1:8888', 'Mensaje a grupo 1',
'mykey', 'mygroup1')
return dict()
------------------------------------------
/views/tv/index.html
{{extend 'layout.html'}}
PRUEBA DE ERROR EN WEBSOCKET - TV1
<h2>Ahora : {{=request.now}}</h2>
<script>
$(document).ready(function(){
// si hay mensaje :
if(!$.web2py.web2py_websocket('ws://
127.0.0.1:8888/realtime/mygroup1',
function(){
document.location.reload(true);
}))
//si no soporta navegador
alert("html5 websocket not supported by your browser, try
Google Chrome");
});
</script>
-----------------------------------------
/views/client/index.html
{{extend 'layout.html'}}
ENVIANDO MENSAJE A GRUPO 1
--------------------------------------------
I have attached the .w2p file if it helps.
Thanks
El 24/01/17 a las 11:15, Marlysson Silva escribió:
> --
> Resources:
> -
http://web2py.com
> -
http://web2py.com/book (Documentation)
> -
http://github.com/web2py/web2py (Source code)
> -
https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
>
https://groups.google.com/d/topic/web2py/-AizF_k-PXA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
>
web2py+un...@googlegroups.com
> <mailto:
web2py+un...@googlegroups.com>.
> For more options, visit
https://groups.google.com/d/optout.