Did I find the right examples for you? yes no

All Samples(8)  |  Call(8)  |  Derive(0)  |  Import(0)

        def patch_ws4py():
    from wsaccel.utf8validator import Utf8Validator
    from wsaccel.xormask import XorMaskerSimple
    from ws4py import streaming, framing

    streaming.Utf8Validator = Utf8Validator

    def mask(self, data):
        if self.masking_key:
            masker = XorMaskerSimple(self.masking_key)
            return masker.process(data)
        return data

    framing.Frame.mask = mask
    framing.Frame.unmask = mask
        


src/w/s/wsaccel-HEAD/examples/ws4py/echo_gevent_server.py   wsaccel(Download)
from ws4py.websocket import EchoWebSocket
 
import wsaccel; wsaccel.patch_ws4py()
 
class BroadcastWebSocket(EchoWebSocket):

src/w/s/wsaccel-HEAD/examples/ws4py/echo_client.py   wsaccel(Download)
# -*- coding: utf-8 -*-
from ws4py.client.threadedclient import WebSocketClient
import wsaccel
wsaccel.patch_ws4py()
 

src/w/e/WebSocket-for-Python-HEAD/example/websensors/app.py   WebSocket-for-Python(Download)
try:
    import wsaccel
    wsaccel.patch_ws4py()
except ImportError:
    pass

src/w/s/wsaccel-HEAD/bench/bench_gevent.py   wsaccel(Download)
            if not patched:
                patched = True
                wsaccel.patch_ws4py()
                start_client()
            else:

src/w/e/WebSocket-for-Python-HEAD/test/autobahn_test_servers.py   WebSocket-for-Python(Download)
    """
    import wsaccel
    wsaccel.patch_ws4py()
    run_cherrypy_server(host, port)
 
    """
    import wsaccel
    wsaccel.patch_ws4py()
    run_cherrypy_server(host, port)
 
    from gevent import monkey; monkey.patch_all()
    import wsaccel
    wsaccel.patch_ws4py()
    from ws4py.websocket import EchoWebSocket
    from ws4py.server.geventserver import WebSocketWSGIApplication, WSGIServer
    import asyncio
    import wsaccel
    wsaccel.patch_ws4py()
    from ws4py.async_websocket import EchoWebSocket
    from ws4py.server.tulipserver import WebSocketProtocol