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
f281e9ab
Commit
f281e9ab
authored
Aug 18, 2013
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Worked on extensions
parent
9d12f4e5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
4 deletions
+12
-4
__init__.py
__init__.py
+1
-0
extension.py
extension.py
+10
-3
websocket.py
websocket.py
+1
-1
No files found.
__init__.py
View file @
f281e9ab
...
...
@@ -8,3 +8,4 @@ from frame import Frame, ControlFrame, OPCODE_CONTINUATION, OPCODE_TEXT, \
from
connection
import
Connection
from
message
import
Message
,
TextMessage
,
BinaryMessage
from
errors
import
SocketClosed
from
extension
import
Extension
,
DeflateFrame
extension.py
View file @
f281e9ab
...
...
@@ -21,6 +21,9 @@ class Extension(object):
setattr
(
self
,
param
,
value
)
def
client_params
(
self
,
frame
):
return
{}
def
hook_send
(
self
,
frame
):
return
frame
...
...
@@ -28,12 +31,13 @@ class Extension(object):
return
frame
class
Deflate
(
Extension
):
class
DeflateFrame
(
Extension
):
name
=
'deflate-frame'
rsv1
=
True
parameters
=
[
'max_window_bits'
,
'no_context_takeover'
]
def
__init__
(
self
,
**
kwargs
):
super
(
Deflate
,
self
).
__init__
(
**
kwargs
)
super
(
Deflate
Frame
,
self
).
__init__
(
**
kwargs
)
self
.
max_window_bits
=
int
(
self
.
max_window_bits
)
def
hook_send
(
self
,
frame
):
...
...
@@ -54,6 +58,9 @@ class Deflate(Extension):
return
frame
def
client_params
(
self
):
raise
NotImplementedError
# TODO
def
encode
(
self
,
data
):
raise
NotImplementedError
# TODO
...
...
@@ -61,7 +68,7 @@ class Deflate(Extension):
raise
NotImplementedError
# TODO
def
filter_
compatible
(
extensions
):
def
filter_
extensions
(
extensions
):
"""
Remove extensions that use conflicting rsv bits and/or opcodes, with the
first options being most preferable.
...
...
websocket.py
View file @
f281e9ab
...
...
@@ -41,7 +41,7 @@ class websocket(object):
`protocols` is a list of supported protocol names.
`extensions` is a list of supported extensions.
`extensions` is a list of supported extension
classe
s.
`origin` (for client sockets) is the value for the "Origin" header sent
in a client handshake .
...
...
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