Hi,

It looks that in Tornado 4.X has been included: * check_origin*, here more 
info:

http://tornado.readthedocs.org/en/latest/websocket.html#tornado.websocket.WebSocketHandler.check_origin

In the DistributeHandler, you can insert the next code:

*def check_origin(self, origin):*
*        return True*

Like this:






*class DistributeHandler(tornado.websocket.WebSocketHandler):    def 
check_origin(self, origin):        return True          def open(self, 
params):    ....*

I have tested and it works for me, I hope it helps...

On Sunday, January 4, 2015 at 4:09:20 PM UTC-5, Tito Garrido wrote:
>
> Hi Folks,
>
> I am using 2.9.11 and when I try to use $.web2py.web2py_websocket('ws://
> 127.0.0.1:8888/realtime/mygroup', function(e){alert(e.data)}) I receive 
> error 403 Forbidden from the server.
>
> Chrome: WebSocket connection to 'ws://127.0.0.1:8888/realtime/mygroup' 
> failed: Error during WebSocket handshake: Unexpected response code: 403
>
> Firefox: 
> Firefox can't establish a connection to the server at ws://127.0.0.1
> :8888/realtime/mygroup.
>
> var ws = new WebSocket(url);
>
>
> From python terminal it works: 
> >> from gluon.contrib.websocket_messaging import websocket_send
> >>> websocket_send('http://127.0.0.1:8888', 'Hello World', 'mykey', 
> 'mygroup')
> ''
> >>> 
>
> What am I missing?
>
> Regards,
>
> Tito
>
> -- 
>
> Linux User #387870
> .........____
> .... _/_õ|__|
> ..º[ .-.___.-._| . . . .
> .__( o)__( o).:_______
>  

-- 
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 the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to