-
Notifications
You must be signed in to change notification settings - Fork 0
Home
SGwebsocket is a part of TALOS Computation Server Project. It has been tested on Chromium and Firefox browsers.
wsServer.py is the main file containing the main loop needed for the (minimalist) server functionality. Unlike many other implementations, I have chosen to read the initial part of a frame with socket.MSG_PEEK and then read the remaining part in a loop no matter how long it is. Messages of length 30K works on both Chromium and Firefox. However, when the message size exceeds 60K Chromium rejects the frame while Firefox accepts. This issue can be resolved by fragmentation in later implementations.
Encoding and decoding the websocket frames are implemented in websocketCoding.py file. RFC 6455 reference is used to decode and encode the frames.
I have included an html file wsClient.html to test the server. (This file should be located on localhost or remote host not local file system.)