autobahn 0.3.1__zip

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. Python27/Lib/site-packages/autobahn/__init__.py +22 -0
  2. Python27/Lib/site-packages/autobahn/__init__.pyc +0 -0
  3. Python27/Lib/site-packages/autobahn/autobahn.py +76 -0
  4. Python27/Lib/site-packages/autobahn/autobahn.pyc +0 -0
  5. Python27/Lib/site-packages/autobahn/case/__init__.py +207 -0
  6. Python27/Lib/site-packages/autobahn/case/__init__.pyc +0 -0
  7. Python27/Lib/site-packages/autobahn/case/case.py +68 -0
  8. Python27/Lib/site-packages/autobahn/case/case.pyc +0 -0
  9. Python27/Lib/site-packages/autobahn/case/case1_1_1.py +31 -0
  10. Python27/Lib/site-packages/autobahn/case/case1_1_1.pyc +0 -0
  11. Python27/Lib/site-packages/autobahn/case/case1_1_2.py +31 -0
  12. Python27/Lib/site-packages/autobahn/case/case1_1_2.pyc +0 -0
  13. Python27/Lib/site-packages/autobahn/case/case1_1_3.py +31 -0
  14. Python27/Lib/site-packages/autobahn/case/case1_1_3.pyc +0 -0
  15. Python27/Lib/site-packages/autobahn/case/case1_1_4.py +31 -0
  16. Python27/Lib/site-packages/autobahn/case/case1_1_4.pyc +0 -0
  17. Python27/Lib/site-packages/autobahn/case/case1_1_5.py +31 -0
  18. Python27/Lib/site-packages/autobahn/case/case1_1_5.pyc +0 -0
  19. Python27/Lib/site-packages/autobahn/case/case1_1_6.py +31 -0
  20. Python27/Lib/site-packages/autobahn/case/case1_1_6.pyc +0 -0
  21. Python27/Lib/site-packages/autobahn/case/case1_1_7.py +31 -0
  22. Python27/Lib/site-packages/autobahn/case/case1_1_7.pyc +0 -0
  23. Python27/Lib/site-packages/autobahn/case/case1_1_8.py +31 -0
  24. Python27/Lib/site-packages/autobahn/case/case1_1_8.pyc +0 -0
  25. Python27/Lib/site-packages/autobahn/case/case1_2_1.py +31 -0
  26. Python27/Lib/site-packages/autobahn/case/case1_2_1.pyc +0 -0
  27. Python27/Lib/site-packages/autobahn/case/case1_2_2.py +31 -0
  28. Python27/Lib/site-packages/autobahn/case/case1_2_2.pyc +0 -0
  29. Python27/Lib/site-packages/autobahn/case/case1_2_3.py +31 -0
  30. Python27/Lib/site-packages/autobahn/case/case1_2_3.pyc +0 -0
  31. Python27/Lib/site-packages/autobahn/case/case1_2_4.py +31 -0
  32. Python27/Lib/site-packages/autobahn/case/case1_2_4.pyc +0 -0
  33. Python27/Lib/site-packages/autobahn/case/case1_2_5.py +31 -0
  34. Python27/Lib/site-packages/autobahn/case/case1_2_5.pyc +0 -0
  35. Python27/Lib/site-packages/autobahn/case/case1_2_6.py +31 -0
  36. Python27/Lib/site-packages/autobahn/case/case1_2_6.pyc +0 -0
  37. Python27/Lib/site-packages/autobahn/case/case1_2_7.py +31 -0
  38. Python27/Lib/site-packages/autobahn/case/case1_2_7.pyc +0 -0
  39. Python27/Lib/site-packages/autobahn/case/case1_2_8.py +31 -0
  40. Python27/Lib/site-packages/autobahn/case/case1_2_8.pyc +0 -0
  41. Python27/Lib/site-packages/autobahn/case/case2_1.py +30 -0
  42. Python27/Lib/site-packages/autobahn/case/case2_1.pyc +0 -0
  43. Python27/Lib/site-packages/autobahn/case/case2_10.py +37 -0
  44. Python27/Lib/site-packages/autobahn/case/case2_10.pyc +0 -0
  45. Python27/Lib/site-packages/autobahn/case/case2_11.py +28 -0
  46. Python27/Lib/site-packages/autobahn/case/case2_11.pyc +0 -0
  47. Python27/Lib/site-packages/autobahn/case/case2_2.py +31 -0
  48. Python27/Lib/site-packages/autobahn/case/case2_2.pyc +0 -0
  49. Python27/Lib/site-packages/autobahn/case/case2_3.py +31 -0
  50. Python27/Lib/site-packages/autobahn/case/case2_3.pyc +0 -0
  51. Python27/Lib/site-packages/autobahn/case/case2_4.py +31 -0
  52. Python27/Lib/site-packages/autobahn/case/case2_4.pyc +0 -0
  53. Python27/Lib/site-packages/autobahn/case/case2_5.py +31 -0
  54. Python27/Lib/site-packages/autobahn/case/case2_5.pyc +0 -0
  55. Python27/Lib/site-packages/autobahn/case/case2_6.py +31 -0
  56. Python27/Lib/site-packages/autobahn/case/case2_6.pyc +0 -0
  57. Python27/Lib/site-packages/autobahn/case/case2_7.py +30 -0
  58. Python27/Lib/site-packages/autobahn/case/case2_7.pyc +0 -0
  59. Python27/Lib/site-packages/autobahn/case/case2_8.py +30 -0
  60. Python27/Lib/site-packages/autobahn/case/case2_8.pyc +0 -0
  61. Python27/Lib/site-packages/autobahn/case/case2_9.py +32 -0
  62. Python27/Lib/site-packages/autobahn/case/case2_9.pyc +0 -0
  63. Python27/Lib/site-packages/autobahn/case/case3_1.py +30 -0
  64. Python27/Lib/site-packages/autobahn/case/case3_1.pyc +0 -0
  65. Python27/Lib/site-packages/autobahn/case/case3_2.py +34 -0
  66. Python27/Lib/site-packages/autobahn/case/case3_2.pyc +0 -0
  67. Python27/Lib/site-packages/autobahn/case/case3_3.py +34 -0
  68. Python27/Lib/site-packages/autobahn/case/case3_3.pyc +0 -0
  69. Python27/Lib/site-packages/autobahn/case/case3_4.py +34 -0
  70. Python27/Lib/site-packages/autobahn/case/case3_4.pyc +0 -0
  71. Python27/Lib/site-packages/autobahn/case/case3_5.py +31 -0
  72. Python27/Lib/site-packages/autobahn/case/case3_5.pyc +0 -0
  73. Python27/Lib/site-packages/autobahn/case/case3_6.py +31 -0
  74. Python27/Lib/site-packages/autobahn/case/case3_6.pyc +0 -0
  75. Python27/Lib/site-packages/autobahn/case/case3_7.py +30 -0
  76. Python27/Lib/site-packages/autobahn/case/case3_7.pyc +0 -0
  77. Python27/Lib/site-packages/autobahn/case/case4_1_1.py +30 -0
  78. Python27/Lib/site-packages/autobahn/case/case4_1_1.pyc +0 -0
  79. Python27/Lib/site-packages/autobahn/case/case4_1_2.py +30 -0
  80. Python27/Lib/site-packages/autobahn/case/case4_1_2.pyc +0 -0
  81. Python27/Lib/site-packages/autobahn/case/case4_1_3.py +34 -0
  82. Python27/Lib/site-packages/autobahn/case/case4_1_3.pyc +0 -0
  83. Python27/Lib/site-packages/autobahn/case/case4_1_4.py +34 -0
  84. Python27/Lib/site-packages/autobahn/case/case4_1_4.pyc +0 -0
  85. Python27/Lib/site-packages/autobahn/case/case4_1_5.py +34 -0
  86. Python27/Lib/site-packages/autobahn/case/case4_1_5.pyc +0 -0
  87. Python27/Lib/site-packages/autobahn/case/case4_2_1.py +30 -0
  88. Python27/Lib/site-packages/autobahn/case/case4_2_1.pyc +0 -0
  89. Python27/Lib/site-packages/autobahn/case/case4_2_2.py +30 -0
  90. Python27/Lib/site-packages/autobahn/case/case4_2_2.pyc +0 -0
  91. Python27/Lib/site-packages/autobahn/case/case4_2_3.py +34 -0
  92. Python27/Lib/site-packages/autobahn/case/case4_2_3.pyc +0 -0
  93. Python27/Lib/site-packages/autobahn/case/case4_2_4.py +34 -0
  94. Python27/Lib/site-packages/autobahn/case/case4_2_4.pyc +0 -0
  95. Python27/Lib/site-packages/autobahn/case/case4_2_5.py +34 -0
  96. Python27/Lib/site-packages/autobahn/case/case4_2_5.pyc +0 -0
  97. Python27/Lib/site-packages/autobahn/case/case5_1.py +31 -0
  98. Python27/Lib/site-packages/autobahn/case/case5_1.pyc +0 -0
  99. Python27/Lib/site-packages/autobahn/case/case5_10.py +31 -0
  100. Python27/Lib/site-packages/autobahn/case/case5_10.pyc +0 -0
  101. Python27/Lib/site-packages/autobahn/case/case5_11.py +31 -0
  102. Python27/Lib/site-packages/autobahn/case/case5_11.pyc +0 -0
  103. Python27/Lib/site-packages/autobahn/case/case5_12.py +31 -0
  104. Python27/Lib/site-packages/autobahn/case/case5_12.pyc +0 -0
  105. Python27/Lib/site-packages/autobahn/case/case5_13.py +31 -0
  106. Python27/Lib/site-packages/autobahn/case/case5_13.pyc +0 -0
  107. Python27/Lib/site-packages/autobahn/case/case5_14.py +31 -0
  108. Python27/Lib/site-packages/autobahn/case/case5_14.pyc +0 -0
  109. Python27/Lib/site-packages/autobahn/case/case5_15.py +35 -0
  110. Python27/Lib/site-packages/autobahn/case/case5_15.pyc +0 -0
  111. Python27/Lib/site-packages/autobahn/case/case5_16.py +33 -0
  112. Python27/Lib/site-packages/autobahn/case/case5_16.pyc +0 -0
  113. Python27/Lib/site-packages/autobahn/case/case5_17.py +33 -0
  114. Python27/Lib/site-packages/autobahn/case/case5_17.pyc +0 -0
  115. Python27/Lib/site-packages/autobahn/case/case5_18.py +31 -0
  116. Python27/Lib/site-packages/autobahn/case/case5_18.pyc +0 -0
  117. Python27/Lib/site-packages/autobahn/case/case5_19.py +56 -0
  118. Python27/Lib/site-packages/autobahn/case/case5_19.pyc +0 -0
  119. Python27/Lib/site-packages/autobahn/case/case5_2.py +31 -0
  120. Python27/Lib/site-packages/autobahn/case/case5_2.pyc +0 -0
  121. Python27/Lib/site-packages/autobahn/case/case5_20.py +31 -0
  122. Python27/Lib/site-packages/autobahn/case/case5_20.pyc +0 -0
  123. Python27/Lib/site-packages/autobahn/case/case5_3.py +32 -0
  124. Python27/Lib/site-packages/autobahn/case/case5_3.pyc +0 -0
  125. Python27/Lib/site-packages/autobahn/case/case5_4.py +32 -0
  126. Python27/Lib/site-packages/autobahn/case/case5_4.pyc +0 -0
  127. Python27/Lib/site-packages/autobahn/case/case5_5.py +32 -0
  128. Python27/Lib/site-packages/autobahn/case/case5_5.pyc +0 -0
  129. Python27/Lib/site-packages/autobahn/case/case5_6.py +34 -0
  130. Python27/Lib/site-packages/autobahn/case/case5_6.pyc +0 -0
  131. Python27/Lib/site-packages/autobahn/case/case5_7.py +34 -0
  132. Python27/Lib/site-packages/autobahn/case/case5_7.pyc +0 -0
  133. Python27/Lib/site-packages/autobahn/case/case5_8.py +34 -0
  134. Python27/Lib/site-packages/autobahn/case/case5_8.pyc +0 -0
  135. Python27/Lib/site-packages/autobahn/case/case5_9.py +31 -0
  136. Python27/Lib/site-packages/autobahn/case/case5_9.pyc +0 -0
  137. Python27/Lib/site-packages/autobahn/case/case6_1.py +30 -0
  138. Python27/Lib/site-packages/autobahn/case/case6_1.pyc +0 -0
  139. Python27/Lib/site-packages/autobahn/case/case6_2.py +32 -0
  140. Python27/Lib/site-packages/autobahn/case/case6_2.pyc +0 -0
  141. Python27/Lib/site-packages/autobahn/case/case6_3.py +33 -0
  142. Python27/Lib/site-packages/autobahn/case/case6_3.pyc +0 -0
  143. Python27/Lib/site-packages/autobahn/case/case9_1_1.py +54 -0
  144. Python27/Lib/site-packages/autobahn/case/case9_1_1.pyc +0 -0
  145. Python27/Lib/site-packages/autobahn/case/case9_1_2.py +31 -0
  146. Python27/Lib/site-packages/autobahn/case/case9_1_2.pyc +0 -0
  147. Python27/Lib/site-packages/autobahn/case/case9_1_3.py +31 -0
  148. Python27/Lib/site-packages/autobahn/case/case9_1_3.pyc +0 -0
  149. Python27/Lib/site-packages/autobahn/case/case9_1_4.py +31 -0
  150. Python27/Lib/site-packages/autobahn/case/case9_1_4.pyc +0 -0
  151. Python27/Lib/site-packages/autobahn/case/case9_1_5.py +31 -0
  152. Python27/Lib/site-packages/autobahn/case/case9_1_5.pyc +0 -0
  153. Python27/Lib/site-packages/autobahn/case/case9_1_6.py +31 -0
  154. Python27/Lib/site-packages/autobahn/case/case9_1_6.pyc +0 -0
  155. Python27/Lib/site-packages/autobahn/case/case9_2_1.py +54 -0
  156. Python27/Lib/site-packages/autobahn/case/case9_2_1.pyc +0 -0
  157. Python27/Lib/site-packages/autobahn/case/case9_2_2.py +31 -0
  158. Python27/Lib/site-packages/autobahn/case/case9_2_2.pyc +0 -0
  159. Python27/Lib/site-packages/autobahn/case/case9_2_3.py +31 -0
  160. Python27/Lib/site-packages/autobahn/case/case9_2_3.pyc +0 -0
  161. Python27/Lib/site-packages/autobahn/case/case9_2_4.py +31 -0
  162. Python27/Lib/site-packages/autobahn/case/case9_2_4.pyc +0 -0
  163. Python27/Lib/site-packages/autobahn/case/case9_2_5.py +31 -0
  164. Python27/Lib/site-packages/autobahn/case/case9_2_5.pyc +0 -0
  165. Python27/Lib/site-packages/autobahn/case/case9_2_6.py +31 -0
  166. Python27/Lib/site-packages/autobahn/case/case9_2_6.pyc +0 -0
  167. Python27/Lib/site-packages/autobahn/case/case9_3_1.py +55 -0
  168. Python27/Lib/site-packages/autobahn/case/case9_3_1.pyc +0 -0
  169. Python27/Lib/site-packages/autobahn/case/case9_3_2.py +32 -0
  170. Python27/Lib/site-packages/autobahn/case/case9_3_2.pyc +0 -0
  171. Python27/Lib/site-packages/autobahn/case/case9_3_3.py +32 -0
  172. Python27/Lib/site-packages/autobahn/case/case9_3_3.pyc +0 -0
  173. Python27/Lib/site-packages/autobahn/case/case9_3_4.py +32 -0
  174. Python27/Lib/site-packages/autobahn/case/case9_3_4.pyc +0 -0
  175. Python27/Lib/site-packages/autobahn/case/case9_3_5.py +32 -0
  176. Python27/Lib/site-packages/autobahn/case/case9_3_5.pyc +0 -0
  177. Python27/Lib/site-packages/autobahn/case/case9_3_6.py +32 -0
  178. Python27/Lib/site-packages/autobahn/case/case9_3_6.pyc +0 -0
  179. Python27/Lib/site-packages/autobahn/case/case9_3_7.py +32 -0
  180. Python27/Lib/site-packages/autobahn/case/case9_3_7.pyc +0 -0
  181. Python27/Lib/site-packages/autobahn/case/case9_3_8.py +32 -0
  182. Python27/Lib/site-packages/autobahn/case/case9_3_8.pyc +0 -0
  183. Python27/Lib/site-packages/autobahn/case/case9_3_9.py +32 -0
  184. Python27/Lib/site-packages/autobahn/case/case9_3_9.pyc +0 -0
  185. Python27/Lib/site-packages/autobahn/case/case9_4_1.py +55 -0
  186. Python27/Lib/site-packages/autobahn/case/case9_4_1.pyc +0 -0
  187. Python27/Lib/site-packages/autobahn/case/case9_4_2.py +32 -0
  188. Python27/Lib/site-packages/autobahn/case/case9_4_2.pyc +0 -0
  189. Python27/Lib/site-packages/autobahn/case/case9_4_3.py +32 -0
  190. Python27/Lib/site-packages/autobahn/case/case9_4_3.pyc +0 -0
  191. Python27/Lib/site-packages/autobahn/case/case9_4_4.py +32 -0
  192. Python27/Lib/site-packages/autobahn/case/case9_4_4.pyc +0 -0
  193. Python27/Lib/site-packages/autobahn/case/case9_4_5.py +32 -0
  194. Python27/Lib/site-packages/autobahn/case/case9_4_5.pyc +0 -0
  195. Python27/Lib/site-packages/autobahn/case/case9_4_6.py +32 -0
  196. Python27/Lib/site-packages/autobahn/case/case9_4_6.pyc +0 -0
  197. Python27/Lib/site-packages/autobahn/case/case9_4_7.py +32 -0
  198. Python27/Lib/site-packages/autobahn/case/case9_4_7.pyc +0 -0
  199. Python27/Lib/site-packages/autobahn/case/case9_4_8.py +32 -0
  200. Python27/Lib/site-packages/autobahn/case/case9_4_8.pyc +0 -0
  201. Python27/Lib/site-packages/autobahn/case/case9_4_9.py +32 -0
  202. Python27/Lib/site-packages/autobahn/case/case9_4_9.pyc +0 -0
  203. Python27/Lib/site-packages/autobahn/case/case9_5_1.py +58 -0
  204. Python27/Lib/site-packages/autobahn/case/case9_5_1.pyc +0 -0
  205. Python27/Lib/site-packages/autobahn/case/case9_5_2.py +28 -0
  206. Python27/Lib/site-packages/autobahn/case/case9_5_2.pyc +0 -0
  207. Python27/Lib/site-packages/autobahn/case/case9_5_3.py +28 -0
  208. Python27/Lib/site-packages/autobahn/case/case9_5_3.pyc +0 -0
  209. Python27/Lib/site-packages/autobahn/case/case9_5_4.py +28 -0
  210. Python27/Lib/site-packages/autobahn/case/case9_5_4.pyc +0 -0
  211. Python27/Lib/site-packages/autobahn/case/case9_5_5.py +28 -0
  212. Python27/Lib/site-packages/autobahn/case/case9_5_5.pyc +0 -0
  213. Python27/Lib/site-packages/autobahn/case/case9_5_6.py +28 -0
  214. Python27/Lib/site-packages/autobahn/case/case9_5_6.pyc +0 -0
  215. Python27/Lib/site-packages/autobahn/case/case9_6_1.py +58 -0
  216. Python27/Lib/site-packages/autobahn/case/case9_6_1.pyc +0 -0
  217. Python27/Lib/site-packages/autobahn/case/case9_6_2.py +28 -0
  218. Python27/Lib/site-packages/autobahn/case/case9_6_2.pyc +0 -0
  219. Python27/Lib/site-packages/autobahn/case/case9_6_3.py +28 -0
  220. Python27/Lib/site-packages/autobahn/case/case9_6_3.pyc +0 -0
  221. Python27/Lib/site-packages/autobahn/case/case9_6_4.py +28 -0
  222. Python27/Lib/site-packages/autobahn/case/case9_6_4.pyc +0 -0
  223. Python27/Lib/site-packages/autobahn/case/case9_6_5.py +28 -0
  224. Python27/Lib/site-packages/autobahn/case/case9_6_5.pyc +0 -0
  225. Python27/Lib/site-packages/autobahn/case/case9_6_6.py +28 -0
  226. Python27/Lib/site-packages/autobahn/case/case9_6_6.pyc +0 -0
  227. Python27/Lib/site-packages/autobahn/fuzzing.py +911 -0
  228. Python27/Lib/site-packages/autobahn/fuzzing.pyc +0 -0
  229. Python27/Lib/site-packages/autobahn/websocket.py +1505 -0
  230. Python27/Lib/site-packages/autobahn/websocket.pyc +0 -0
  231. Python27/Lib/site-packages/autobahn-0.3.1-py2.7.egg-info/PKG-INFO +10 -0
  232. Python27/Lib/site-packages/autobahn-0.3.1-py2.7.egg-info/SOURCES.txt +124 -0
  233. Python27/Lib/site-packages/autobahn-0.3.1-py2.7.egg-info/dependency_links.txt +1 -0
  234. Python27/Lib/site-packages/autobahn-0.3.1-py2.7.egg-info/not-zip-safe +1 -0
  235. Python27/Lib/site-packages/autobahn-0.3.1-py2.7.egg-info/requires.txt +1 -0
  236. Python27/Lib/site-packages/autobahn-0.3.1-py2.7.egg-info/top_level.txt +1 -0
@@ -0,0 +1,22 @@
1
+ ###############################################################################
2
+ ##
3
+ ## Copyright 2011 Tavendo GmbH
4
+ ##
5
+ ## Licensed under the Apache License, Version 2.0 (the "License");
6
+ ## you may not use this file except in compliance with the License.
7
+ ## You may obtain a copy of the License at
8
+ ##
9
+ ## http://www.apache.org/licenses/LICENSE-2.0
10
+ ##
11
+ ## Unless required by applicable law or agreed to in writing, software
12
+ ## distributed under the License is distributed on an "AS IS" BASIS,
13
+ ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ ## See the License for the specific language governing permissions and
15
+ ## limitations under the License.
16
+ ##
17
+ ###############################################################################
18
+
19
+ import websocket
20
+ import autobahn
21
+ import fuzzing
22
+ import case
@@ -0,0 +1,76 @@
1
+ ###############################################################################
2
+ ##
3
+ ## Copyright 2011 Tavendo GmbH
4
+ ##
5
+ ## Licensed under the Apache License, Version 2.0 (the "License");
6
+ ## you may not use this file except in compliance with the License.
7
+ ## You may obtain a copy of the License at
8
+ ##
9
+ ## http://www.apache.org/licenses/LICENSE-2.0
10
+ ##
11
+ ## Unless required by applicable law or agreed to in writing, software
12
+ ## distributed under the License is distributed on an "AS IS" BASIS,
13
+ ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ ## See the License for the specific language governing permissions and
15
+ ## limitations under the License.
16
+ ##
17
+ ###############################################################################
18
+
19
+ from websocket import WebSocketServerFactory, WebSocketServerProtocol, HttpException
20
+ import json
21
+
22
+ class AutobahnServerProtocol(WebSocketServerProtocol):
23
+
24
+ def onConnect(self, host, path, params, origin, protocols):
25
+ if self.debug:
26
+ log.msg("connection received from %s for host %s, path %s, parms %s, origin %s, protocols %s" % (self.peerstr, host, path, str(params), origin, str(protocols)))
27
+ return None
28
+ #raise HttpException(401, "Authenticate first!")
29
+
30
+ def onOpen(self):
31
+ print "Connection now open."
32
+ # self.initial_ping_payload = ''.join([random.choice("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_") for i in range(16)])
33
+ # self.initial_pong_received = False
34
+ # self.sendPing(self.initial_ping_payload);
35
+
36
+ def onPing(self, payload):
37
+ print "PING received : ", str(payload)
38
+ self.sendPong(payload)
39
+
40
+
41
+ def onPong(self, payload):
42
+ print "PONG received : ", str(payload)
43
+ if not self.initial_pong_received:
44
+ if payload == self.initial_ping_payload:
45
+ #print "initial ping/pong finished!"
46
+ self.initial_pong_received = True
47
+ self.onOpen()
48
+ else:
49
+ pass
50
+ #print "initial ping/pong failure"
51
+
52
+ def onClose(self):
53
+ print "Client lost."
54
+
55
+ def onMessage(self, msg, binary):
56
+ try:
57
+ obj = json.loads(msg)
58
+ except:
59
+ print "could not parse JSON"
60
+ print msg
61
+ # self.sendCloseFrame(WebSocketServiceConnection.CLOSE_STATUS_CODE_PROTOCOL_ERROR, "data frame using reserved opcode")
62
+ # self.sendCloseFrame(3000, "data frame using reserved opcode")
63
+ res = {"name": "Tobias", "age": 38}
64
+ self.sendMessage(json.dumps(res))
65
+
66
+
67
+ class AutobahnService(WebSocketServerFactory):
68
+
69
+ def __init__(self):
70
+ self.protocol = AutobahnServerProtocol
71
+
72
+ def startFactory(self):
73
+ pass
74
+
75
+ def stopFactory(self):
76
+ pass
@@ -0,0 +1,207 @@
1
+ ###############################################################################
2
+ ##
3
+ ## Copyright 2011 Tavendo GmbH
4
+ ##
5
+ ## Licensed under the Apache License, Version 2.0 (the "License");
6
+ ## you may not use this file except in compliance with the License.
7
+ ## You may obtain a copy of the License at
8
+ ##
9
+ ## http://www.apache.org/licenses/LICENSE-2.0
10
+ ##
11
+ ## Unless required by applicable law or agreed to in writing, software
12
+ ## distributed under the License is distributed on an "AS IS" BASIS,
13
+ ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ ## See the License for the specific language governing permissions and
15
+ ## limitations under the License.
16
+ ##
17
+ ###############################################################################
18
+
19
+ ##
20
+ ## To add new cases
21
+ ##
22
+ ## 1) create a class in subdir "case" (derived from Case, and appropriately named)
23
+ ## 2) import the class here (see below)
24
+ ## 3) add class to Cases list (see below)
25
+ ##
26
+
27
+ ##
28
+ ## Case classes are named "CaseX_Y_Z" where X is from these test case categories:
29
+ ##
30
+ CaseCategories = {"0": "Handshake",
31
+ "1": "Framing",
32
+ "2": "Pings/Pongs",
33
+ "3": "Reserved Bits",
34
+ "4": "Opcodes",
35
+ "5": "Fragmentation",
36
+ "6": "UTF-8 Handling",
37
+ "7": "Close Handling",
38
+ "8": "Misc",
39
+ "9": "Limits/Performance"}
40
+
41
+ CaseSubCategories = {"1.1": "Text Messages",
42
+ "1.2": "Binary Messages",
43
+ "4.1": "Non-control Opcodes",
44
+ "4.2": "Control Opcodes",
45
+ "9.1": "Text Message (increasing size)",
46
+ "9.2": "Binary Message (increasing size)",
47
+ "9.3": "Fragmented Text Message (fixed size, increasing fragment size)",
48
+ "9.4": "Fragmented Binary Message (fixed size, increasing fragment size)",
49
+ "9.5": "Text Message (fixed size, increasing chop size)",
50
+ "9.6": "Binary Text Message (fixed size, increasing chop size)"}
51
+
52
+ ##
53
+ ## Cases
54
+ ##
55
+
56
+ from case1_1_1 import *
57
+ from case1_1_2 import *
58
+ from case1_1_3 import *
59
+ from case1_1_4 import *
60
+ from case1_1_5 import *
61
+ from case1_1_6 import *
62
+ from case1_1_7 import *
63
+ from case1_1_8 import *
64
+
65
+ from case1_2_1 import *
66
+ from case1_2_2 import *
67
+ from case1_2_3 import *
68
+ from case1_2_4 import *
69
+ from case1_2_5 import *
70
+ from case1_2_6 import *
71
+ from case1_2_7 import *
72
+ from case1_2_8 import *
73
+
74
+ from case2_1 import *
75
+ from case2_2 import *
76
+ from case2_3 import *
77
+ from case2_4 import *
78
+ from case2_5 import *
79
+ from case2_6 import *
80
+ from case2_7 import *
81
+ from case2_8 import *
82
+ from case2_9 import *
83
+ from case2_10 import *
84
+ from case2_11 import *
85
+
86
+ from case3_1 import *
87
+ from case3_2 import *
88
+ from case3_3 import *
89
+ from case3_4 import *
90
+ from case3_5 import *
91
+ from case3_6 import *
92
+ from case3_7 import *
93
+
94
+ from case4_1_1 import *
95
+ from case4_1_2 import *
96
+ from case4_1_3 import *
97
+ from case4_1_4 import *
98
+ from case4_1_5 import *
99
+
100
+ from case4_2_1 import *
101
+ from case4_2_2 import *
102
+ from case4_2_3 import *
103
+ from case4_2_4 import *
104
+ from case4_2_5 import *
105
+
106
+ from case5_1 import *
107
+ from case5_2 import *
108
+ from case5_3 import *
109
+ from case5_4 import *
110
+ from case5_5 import *
111
+ from case5_6 import *
112
+ from case5_7 import *
113
+ from case5_8 import *
114
+ from case5_9 import *
115
+ from case5_10 import *
116
+ from case5_11 import *
117
+ from case5_12 import *
118
+ from case5_13 import *
119
+ from case5_14 import *
120
+ from case5_15 import *
121
+ from case5_16 import *
122
+ from case5_17 import *
123
+ from case5_18 import *
124
+ from case5_19 import *
125
+ from case5_20 import *
126
+
127
+ from case6_1 import *
128
+ from case6_2 import *
129
+ from case6_3 import *
130
+
131
+ from case9_1_1 import *
132
+ from case9_1_2 import *
133
+ from case9_1_3 import *
134
+ from case9_1_4 import *
135
+ from case9_1_5 import *
136
+ from case9_1_6 import *
137
+
138
+ from case9_2_1 import *
139
+ from case9_2_2 import *
140
+ from case9_2_3 import *
141
+ from case9_2_4 import *
142
+ from case9_2_5 import *
143
+ from case9_2_6 import *
144
+
145
+ from case9_3_1 import *
146
+ from case9_3_2 import *
147
+ from case9_3_3 import *
148
+ from case9_3_4 import *
149
+ from case9_3_5 import *
150
+ from case9_3_6 import *
151
+ from case9_3_7 import *
152
+ from case9_3_8 import *
153
+ from case9_3_9 import *
154
+
155
+ from case9_4_1 import *
156
+ from case9_4_2 import *
157
+ from case9_4_3 import *
158
+ from case9_4_4 import *
159
+ from case9_4_5 import *
160
+ from case9_4_6 import *
161
+ from case9_4_7 import *
162
+ from case9_4_8 import *
163
+ from case9_4_9 import *
164
+
165
+ from case9_5_1 import *
166
+ from case9_5_2 import *
167
+ from case9_5_3 import *
168
+ from case9_5_4 import *
169
+ from case9_5_5 import *
170
+ from case9_5_6 import *
171
+
172
+ from case9_6_1 import *
173
+ from case9_6_2 import *
174
+ from case9_6_3 import *
175
+ from case9_6_4 import *
176
+ from case9_6_5 import *
177
+ from case9_6_6 import *
178
+
179
+ ##
180
+ ## This is the list of Case classes that will be run by the fuzzing server/client
181
+ ##
182
+ Cases = []
183
+ Cases += [Case1_1_1, Case1_1_2, Case1_1_3, Case1_1_4, Case1_1_5, Case1_1_6, Case1_1_7, Case1_1_8]
184
+ Cases += [Case1_2_1, Case1_2_2, Case1_2_3, Case1_2_4, Case1_2_5, Case1_2_6, Case1_2_7, Case1_2_8]
185
+ Cases += [Case2_1, Case2_2, Case2_3, Case2_4, Case2_5, Case2_6, Case2_7, Case2_8, Case2_9, Case2_10, Case2_11]
186
+ Cases += [Case3_1, Case3_2, Case3_3, Case3_4, Case3_5, Case3_6, Case3_7]
187
+ Cases += [Case4_1_1, Case4_1_2, Case4_1_3, Case4_1_4, Case4_1_5]
188
+ Cases += [Case4_2_1, Case4_2_2, Case4_2_3, Case4_2_4, Case4_2_5]
189
+ Cases += [Case5_1, Case5_2, Case5_3, Case5_4, Case5_5, Case5_6, Case5_7, Case5_8, Case5_9, Case5_10, Case5_11, Case5_12, Case5_13, Case5_14, Case5_15, Case5_16, Case5_17, Case5_18, Case5_19, Case5_20]
190
+ Cases += [Case6_1, Case6_2, Case6_3]
191
+ Cases += [Case9_1_1, Case9_1_2, Case9_1_3, Case9_1_4, Case9_1_5, Case9_1_6]
192
+ Cases += [Case9_2_1, Case9_2_2, Case9_2_3, Case9_2_4, Case9_2_5, Case9_2_6]
193
+ Cases += [Case9_3_1, Case9_3_2, Case9_3_3, Case9_3_4, Case9_3_5, Case9_3_6, Case9_3_7, Case9_3_8, Case9_3_9]
194
+ Cases += [Case9_4_1, Case9_4_2, Case9_4_3, Case9_4_4, Case9_4_5, Case9_4_6, Case9_4_7, Case9_4_8, Case9_4_9]
195
+ Cases += [Case9_5_1, Case9_5_2, Case9_5_3, Case9_5_4, Case9_5_5, Case9_5_6]
196
+ Cases += [Case9_6_1, Case9_6_2, Case9_6_3, Case9_6_4, Case9_6_5, Case9_6_6]
197
+
198
+
199
+ ## Class1_2_3 => '1.2.3'
200
+ ##
201
+ def caseClasstoId(klass):
202
+ return '.'.join(klass.__name__[4:].split("_"))
203
+
204
+ ## Class1_2_3 => (1, 2, 3)
205
+ ##
206
+ def caseClasstoIdTuple(klass):
207
+ return tuple([int(x) for x in klass.__name__[4:].split("_")])
@@ -0,0 +1,68 @@
1
+ ###############################################################################
2
+ ##
3
+ ## Copyright 2011 Tavendo GmbH
4
+ ##
5
+ ## Licensed under the Apache License, Version 2.0 (the "License");
6
+ ## you may not use this file except in compliance with the License.
7
+ ## You may obtain a copy of the License at
8
+ ##
9
+ ## http://www.apache.org/licenses/LICENSE-2.0
10
+ ##
11
+ ## Unless required by applicable law or agreed to in writing, software
12
+ ## distributed under the License is distributed on an "AS IS" BASIS,
13
+ ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ ## See the License for the specific language governing permissions and
15
+ ## limitations under the License.
16
+ ##
17
+ ###############################################################################
18
+
19
+ from autobahn.websocket import WebSocketProtocol
20
+ from twisted.python import log
21
+ import pickle
22
+ import textwrap
23
+
24
+
25
+ class Case:
26
+
27
+ FAILED = "FAILED"
28
+ OK = "OK"
29
+ NON_STRICT = "NON-STRICT"
30
+
31
+ def __init__(self, protocol):
32
+ self.p = protocol
33
+ self.received = []
34
+ self.expected = {}
35
+ self.behavior = Case.FAILED
36
+ self.result = "Actual events differ from any expected."
37
+ self.reportTime = False
38
+ self.init()
39
+
40
+ def init(self):
41
+ pass
42
+
43
+ def onOpen(self):
44
+ pass
45
+
46
+ def onMessage(self, msg, binary):
47
+ self.received.append(("message", msg, binary))
48
+
49
+ def onPing(self, payload):
50
+ self.received.append(("ping", payload))
51
+
52
+ def onPong(self, payload):
53
+ self.received.append(("pong", payload))
54
+
55
+ def onClose(self, code, reason):
56
+ pass
57
+
58
+ def compare(self, obj1, obj2):
59
+ return pickle.dumps(obj1) == pickle.dumps(obj2)
60
+
61
+ def onConnectionLost(self, failedByMe):
62
+ self.received.append(("failedByMe", failedByMe))
63
+ for e in self.expected:
64
+ if self.compare(self.received, self.expected[e]):
65
+ self.behavior = e
66
+ self.passed = True
67
+ self.result = "Actual events match at least one expected."
68
+ break
@@ -0,0 +1,31 @@
1
+ ###############################################################################
2
+ ##
3
+ ## Copyright 2011 Tavendo GmbH
4
+ ##
5
+ ## Licensed under the Apache License, Version 2.0 (the "License");
6
+ ## you may not use this file except in compliance with the License.
7
+ ## You may obtain a copy of the License at
8
+ ##
9
+ ## http://www.apache.org/licenses/LICENSE-2.0
10
+ ##
11
+ ## Unless required by applicable law or agreed to in writing, software
12
+ ## distributed under the License is distributed on an "AS IS" BASIS,
13
+ ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ ## See the License for the specific language governing permissions and
15
+ ## limitations under the License.
16
+ ##
17
+ ###############################################################################
18
+
19
+ from case import Case
20
+
21
+ class Case1_1_1(Case):
22
+
23
+ DESCRIPTION = """Send text message with payload 0."""
24
+
25
+ EXPECTATION = """Receive echo'ed text message (with empty payload)."""
26
+
27
+ def onOpen(self):
28
+ payload = ""
29
+ self.expected[Case.OK] = [("message", payload, False), ("failedByMe", True)]
30
+ self.p.sendFrame(opcode = 1, payload = payload)
31
+ self.p.killAfter(1)
@@ -0,0 +1,31 @@
1
+ ###############################################################################
2
+ ##
3
+ ## Copyright 2011 Tavendo GmbH
4
+ ##
5
+ ## Licensed under the Apache License, Version 2.0 (the "License");
6
+ ## you may not use this file except in compliance with the License.
7
+ ## You may obtain a copy of the License at
8
+ ##
9
+ ## http://www.apache.org/licenses/LICENSE-2.0
10
+ ##
11
+ ## Unless required by applicable law or agreed to in writing, software
12
+ ## distributed under the License is distributed on an "AS IS" BASIS,
13
+ ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ ## See the License for the specific language governing permissions and
15
+ ## limitations under the License.
16
+ ##
17
+ ###############################################################################
18
+
19
+ from case import Case
20
+
21
+ class Case1_1_2(Case):
22
+
23
+ DESCRIPTION = """Send text message message with payload of length 125."""
24
+
25
+ EXPECTATION = """Receive echo'ed text message (with payload as sent)."""
26
+
27
+ def onOpen(self):
28
+ payload = "*" * 125
29
+ self.expected[Case.OK] = [("message", payload, False), ("failedByMe", True)]
30
+ self.p.sendFrame(opcode = 1, payload = payload)
31
+ self.p.killAfter(1)
@@ -0,0 +1,31 @@
1
+ ###############################################################################
2
+ ##
3
+ ## Copyright 2011 Tavendo GmbH
4
+ ##
5
+ ## Licensed under the Apache License, Version 2.0 (the "License");
6
+ ## you may not use this file except in compliance with the License.
7
+ ## You may obtain a copy of the License at
8
+ ##
9
+ ## http://www.apache.org/licenses/LICENSE-2.0
10
+ ##
11
+ ## Unless required by applicable law or agreed to in writing, software
12
+ ## distributed under the License is distributed on an "AS IS" BASIS,
13
+ ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ ## See the License for the specific language governing permissions and
15
+ ## limitations under the License.
16
+ ##
17
+ ###############################################################################
18
+
19
+ from case import Case
20
+
21
+ class Case1_1_3(Case):
22
+
23
+ DESCRIPTION = """Send text message message with payload of length 126."""
24
+
25
+ EXPECTATION = """Receive echo'ed text message (with payload as sent)."""
26
+
27
+ def onOpen(self):
28
+ payload = "*" * 126
29
+ self.expected[Case.OK] = [("message", payload, False), ("failedByMe", True)]
30
+ self.p.sendFrame(opcode = 1, payload = payload)
31
+ self.p.killAfter(1)
@@ -0,0 +1,31 @@
1
+ ###############################################################################
2
+ ##
3
+ ## Copyright 2011 Tavendo GmbH
4
+ ##
5
+ ## Licensed under the Apache License, Version 2.0 (the "License");
6
+ ## you may not use this file except in compliance with the License.
7
+ ## You may obtain a copy of the License at
8
+ ##
9
+ ## http://www.apache.org/licenses/LICENSE-2.0
10
+ ##
11
+ ## Unless required by applicable law or agreed to in writing, software
12
+ ## distributed under the License is distributed on an "AS IS" BASIS,
13
+ ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ ## See the License for the specific language governing permissions and
15
+ ## limitations under the License.
16
+ ##
17
+ ###############################################################################
18
+
19
+ from case import Case
20
+
21
+ class Case1_1_4(Case):
22
+
23
+ DESCRIPTION = """Send text message message with payload of length 127."""
24
+
25
+ EXPECTATION = """Receive echo'ed text message (with payload as sent)."""
26
+
27
+ def onOpen(self):
28
+ payload = "*" * 127
29
+ self.expected[Case.OK] = [("message", payload, False), ("failedByMe", True)]
30
+ self.p.sendFrame(opcode = 1, payload = payload)
31
+ self.p.killAfter(1)
@@ -0,0 +1,31 @@
1
+ ###############################################################################
2
+ ##
3
+ ## Copyright 2011 Tavendo GmbH
4
+ ##
5
+ ## Licensed under the Apache License, Version 2.0 (the "License");
6
+ ## you may not use this file except in compliance with the License.
7
+ ## You may obtain a copy of the License at
8
+ ##
9
+ ## http://www.apache.org/licenses/LICENSE-2.0
10
+ ##
11
+ ## Unless required by applicable law or agreed to in writing, software
12
+ ## distributed under the License is distributed on an "AS IS" BASIS,
13
+ ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ ## See the License for the specific language governing permissions and
15
+ ## limitations under the License.
16
+ ##
17
+ ###############################################################################
18
+
19
+ from case import Case
20
+
21
+ class Case1_1_5(Case):
22
+
23
+ DESCRIPTION = """Send text message message with payload of length 128."""
24
+
25
+ EXPECTATION = """Receive echo'ed text message (with payload as sent)."""
26
+
27
+ def onOpen(self):
28
+ payload = "*" * 128
29
+ self.expected[Case.OK] = [("message", payload, False), ("failedByMe", True)]
30
+ self.p.sendFrame(opcode = 1, payload = payload)
31
+ self.p.killAfter(1)
@@ -0,0 +1,31 @@
1
+ ###############################################################################
2
+ ##
3
+ ## Copyright 2011 Tavendo GmbH
4
+ ##
5
+ ## Licensed under the Apache License, Version 2.0 (the "License");
6
+ ## you may not use this file except in compliance with the License.
7
+ ## You may obtain a copy of the License at
8
+ ##
9
+ ## http://www.apache.org/licenses/LICENSE-2.0
10
+ ##
11
+ ## Unless required by applicable law or agreed to in writing, software
12
+ ## distributed under the License is distributed on an "AS IS" BASIS,
13
+ ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ ## See the License for the specific language governing permissions and
15
+ ## limitations under the License.
16
+ ##
17
+ ###############################################################################
18
+
19
+ from case import Case
20
+
21
+ class Case1_1_6(Case):
22
+
23
+ DESCRIPTION = """Send text message message with payload of length 65536."""
24
+
25
+ EXPECTATION = """Receive echo'ed text message (with payload as sent)."""
26
+
27
+ def onOpen(self):
28
+ payload = "*" * 65536
29
+ self.expected[Case.OK] = [("message", payload, False), ("failedByMe", True)]
30
+ self.p.sendFrame(opcode = 1, payload = payload)
31
+ self.p.killAfter(1)
@@ -0,0 +1,31 @@
1
+ ###############################################################################
2
+ ##
3
+ ## Copyright 2011 Tavendo GmbH
4
+ ##
5
+ ## Licensed under the Apache License, Version 2.0 (the "License");
6
+ ## you may not use this file except in compliance with the License.
7
+ ## You may obtain a copy of the License at
8
+ ##
9
+ ## http://www.apache.org/licenses/LICENSE-2.0
10
+ ##
11
+ ## Unless required by applicable law or agreed to in writing, software
12
+ ## distributed under the License is distributed on an "AS IS" BASIS,
13
+ ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ ## See the License for the specific language governing permissions and
15
+ ## limitations under the License.
16
+ ##
17
+ ###############################################################################
18
+
19
+ from case import Case
20
+
21
+ class Case1_1_7(Case):
22
+
23
+ DESCRIPTION = """Send text message message with payload of length 65537."""
24
+
25
+ EXPECTATION = """Receive echo'ed text message (with payload as sent)."""
26
+
27
+ def onOpen(self):
28
+ payload = "*" * 65537
29
+ self.expected[Case.OK] = [("message", payload, False), ("failedByMe", True)]
30
+ self.p.sendFrame(opcode = 1, payload = payload)
31
+ self.p.killAfter(1)
@@ -0,0 +1,31 @@
1
+ ###############################################################################
2
+ ##
3
+ ## Copyright 2011 Tavendo GmbH
4
+ ##
5
+ ## Licensed under the Apache License, Version 2.0 (the "License");
6
+ ## you may not use this file except in compliance with the License.
7
+ ## You may obtain a copy of the License at
8
+ ##
9
+ ## http://www.apache.org/licenses/LICENSE-2.0
10
+ ##
11
+ ## Unless required by applicable law or agreed to in writing, software
12
+ ## distributed under the License is distributed on an "AS IS" BASIS,
13
+ ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ ## See the License for the specific language governing permissions and
15
+ ## limitations under the License.
16
+ ##
17
+ ###############################################################################
18
+
19
+ from case import Case
20
+
21
+ class Case1_1_8(Case):
22
+
23
+ DESCRIPTION = """Send text message message with payload of length 65537. Sent out data in chops of 997 octets."""
24
+
25
+ EXPECTATION = """Receive echo'ed text message (with payload as sent)."""
26
+
27
+ def onOpen(self):
28
+ payload = "*" * 65537
29
+ self.expected[Case.OK] = [("message", payload, False), ("failedByMe", True)]
30
+ self.p.sendFrame(opcode = 1, payload = payload, chopsize = 997)
31
+ self.p.killAfter(1)