Giter VIP home page Giter VIP logo

txwebsocket's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

txwebsocket's Issues

Order of the keys for the challenge

The protocol mentions that the challenge must be computed with concatenation of the keys as "sent on the wire" (the client should shuffle the headers). The current version always takes the order Sec-WebSocket-Key1, Sec-WebSocket-Key2.

connectionMade implementation not available

Hello,
Is there a way to get access to "connectionMade" so code can be ran when a socket is opened? I'm new to twisted and tried to expose this function, but couldn't figure it out. Thanks.

Handler Never Gets Deleted

del for my websockethandler never gets called, the object is never freed even when connections are lost

IndexError exception when disconnecting

I've encountered a bug. I can get clients to connect to the server via websockets but when the client disconnects there is an error :
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\twisted\python\log.py", line 84, in callWithLogger
return callWithContext({"system": lp}, func, _args, *_kw)
File "C:\Python27\lib\site-packages\twisted\python\log.py", line 69, in callWithContext
return context.call({ILogContext: newCtx}, func, _args, *_kw)
File "C:\Python27\lib\site-packages\twisted\python\context.py", line 59, in callWithContext
return self.currentContext().callWithContext(ctx, func, _args, *_kw)
File "C:\Python27\lib\site-packages\twisted\python\context.py", line 37, in callWithContext
return func(args,*kw)
--- ---
File "C:\Python27\lib\site-packages\twisted\internet\selectreactor.py", line 146, in _doReadOrWrite
why = getattr(selectable, method)()
File "C:\Python27\lib\site-packages\twisted\internet\tcp.py", line 460, in doRead
return self.protocol.dataReceived(data)
File "C:\Python27\lib\site-packages\twisted\protocols\basic.py", line 572, in dataReceived
return self.rawDataReceived(data)
File "C:\Python27\lib\site-packages\twisted\web\http.py", line 1645, in rawDataReceived
self._transferDecoder.dataReceived(data)
File "C:\Users\Clem\Desktop\3IF\fil rouge\ServeurPR\websocket.py", line 468, in dataReceived
if frame[0] != "\x00":
exceptions.IndexError: string index out of range

I'm using http://websocket.org/echo.html connecting to my local server. I can provide you if you want some network traces.

'Connection' header in FF 7.0.1

Firefox 7.0.1 sets 'connection' header not to "Upgrade", but "keep-alive, Upgrade".

The next change in WebSocketRequest.process method fixes the problem:

57 line:

  •    if connection != "Upgrade"
    
    •    if connection not in ("Upgrade", "keep-alive, Upgrade")
      

Factory compatibility

For my project, I'd want to be able to put a factory in the Web Socket hierarchy. Could this be implemented?

_IdentityTransferDecoder

I get the error ImportError: cannot import name _IdentityTransferDecoder. Google came up with no results. I have Python 2.7

__init__ in simple_server.py example fired twice from one connection?

In the simple_server.py example, I added only print "init" under the init method.

class Testhandler(WebSocketHandler):
def init(self, transport):
WebSocketHandler.init(self, transport)
self.periodic_call = task.LoopingCall(self.send_time)
print "init", self, transport

On the client-side this is the only code being executed:

var ws = new WebSocket("ws://109.74.200.181:8090/test");
ws.onopen = function()
{
alert('onopen fired!');
//ws.send("message to send");
};

(As you can see I changed the port in this example, but no other changes were made)

This causes output from ONE connection:

init <main.Testhandler object at 0x9e70a6c> <websocket.WebSocketTransport object at 0x9e7018c>
init <main.Testhandler object at 0x9e7062c> <websocket.WebSocketTransport object at 0x9e7018c>

I'm not good at this but it looks like there's two "selfs" or instances being made. And when the browser is being closed, connectionLost is only fired once. This has led to some strange behaviour in one of my applications. Users getting an increasing number of transports added to their "client", never getting cleaned out or "connectionLost".

Can you replicate this, or is it intended?

Unable to run code in windows

Following is the traceback from running the code.

Traceback (most recent call last):
  File "simple_server.py", line 72, in <module>
    site = WebSocketSite(root)
  File "C:\Users\piyushdivyankar\Documents\Projects\asynchronous-programming\txW
ebSocket-master\txWebSocket-master\websocket.py", line 279, in __init__
    Site.__init__(self, resource, logPath, timeout)
  File "C:\Program Files\Anaconda2\lib\site-packages\twisted\web\server.py", lin
e 698, in __init__
    http.HTTPFactory.__init__(self, *args, **kwargs)
  File "C:\Program Files\Anaconda2\lib\site-packages\twisted\web\http.py", line
2789, in __init__
    logPath = os.path.abspath(logPath)
  File "C:\Program Files\Anaconda2\lib\ntpath.py", line 488, in abspath
    path = _getfullpathname(path)
TypeError: coercing to Unicode: need string or buffer, int found

Tried to change the value of root to a string with absolute file path, but that didn't work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.