Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wspy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
wspy
Commits
822bfe72
Commit
822bfe72
authored
Nov 07, 2012
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some comments
parent
e169d77a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
websocket.py
websocket.py
+10
-1
No files found.
websocket.py
View file @
822bfe72
...
@@ -14,7 +14,16 @@ WS_VERSION = '13'
...
@@ -14,7 +14,16 @@ WS_VERSION = '13'
class
WebSocket
(
object
):
class
WebSocket
(
object
):
"""
A WebSocket upgrades a regular TCP socket to a web socket. The class
implements the handshake protocol as defined by RFC 6455, provides
abstracted methods for sending (optionally fragmented) messages, and
automatically handles control messages.
"""
def
__init__
(
self
,
sock
):
def
__init__
(
self
,
sock
):
"""
`sock' is a regular TCP socket instance.
"""
self
.
sock
=
sock
self
.
sock
=
sock
self
.
received_close_params
=
None
self
.
received_close_params
=
None
...
@@ -60,7 +69,7 @@ class WebSocket(object):
...
@@ -60,7 +69,7 @@ class WebSocket(object):
"""
"""
Execute a handshake with the other end point of the socket. If the HTTP
Execute a handshake with the other end point of the socket. If the HTTP
request headers read from the socket are invalid, an InvalidRequest
request headers read from the socket are invalid, an InvalidRequest
exception
will be
raised.
exception
is
raised.
"""
"""
raw_headers
=
self
.
sock
.
recv
(
512
).
decode
(
'utf-8'
,
'ignore'
)
raw_headers
=
self
.
sock
.
recv
(
512
).
decode
(
'utf-8'
,
'ignore'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment