Open themindfactory opened 3 years ago
are you really in python or on an other language :D
I'm currently working on a project, where i want to use it, too and i'm facing exactly the same problem
Found the class "WebSocket" in SimpleWebSocketServer.py from the package. I'd recommend doing a "fork" of it or download a copy,
Hope it helps :)
best regards & happy coding
Sascha
Use inherit.
For example:
from SimpleWebSocketServer import SimpleWebSocketServer, WebSocket
class WSRequestHandler(WebSocket):
def __init__(self, server, sock, address):
super(WSRequestHandler, self).__init__(server, sock, address)
... # something yet
... # other methods
class SimpleWSServer(SimpleWebSocketServer):
... # some attrs
def __init__(self, host, port, websocketclass, **kwargs):
... # something yet
super(SimpleWSServer, self).__init__(host, port, websocketclass)
... # something yet
server = SimpleWSServer(HOST, PORT, WSRequestHandler)
server.serveforever()
for every connection I want to store other variables...
in the class SimpleChat I added
nothing seems to work, not sure where to go....
hoping a python guru comes to my assistance... :-)