server.accept-failed-ws-key.json 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. [
  2. {
  3. "function": "stream_socket_accept",
  4. "params": [
  5. "@mock-socket"
  6. ],
  7. "return": "@mock-stream"
  8. },
  9. {
  10. "function": "stream_socket_get_name",
  11. "params": [
  12. "@mock-stream"
  13. ],
  14. "return": "127.0.0.1:12345"
  15. },
  16. {
  17. "function": "stream_get_line",
  18. "params": [
  19. "@mock-stream",
  20. 1024,
  21. "\r\n"
  22. ],
  23. "return": "GET \/my\/mock\/path HTTP\/1.1"
  24. },
  25. {
  26. "function": "stream_get_meta_data",
  27. "params": [
  28. "@mock-stream"
  29. ],
  30. "return": {
  31. "timed_out": false,
  32. "blocked": true,
  33. "eof": false,
  34. "stream_type": "tcp_socket\/ssl",
  35. "mode": "r+",
  36. "unread_bytes": 171,
  37. "seekable": false
  38. }
  39. },
  40. {
  41. "function": "feof",
  42. "params": [
  43. "@mock-stream"
  44. ],
  45. "return": false
  46. },
  47. {
  48. "function": "stream_get_line",
  49. "params": [
  50. "@mock-stream",
  51. 1024,
  52. "\r\n"
  53. ],
  54. "return": "host: localhost:8000"
  55. },
  56. {
  57. "function": "stream_get_meta_data",
  58. "params": [
  59. "@mock-stream"
  60. ],
  61. "return": {
  62. "timed_out": false,
  63. "blocked": true,
  64. "eof": false,
  65. "stream_type": "tcp_socket\/ssl",
  66. "mode": "r+",
  67. "unread_bytes": 149,
  68. "seekable": false
  69. }
  70. },
  71. {
  72. "function": "feof",
  73. "params": [
  74. "@mock-stream"
  75. ],
  76. "return": false
  77. },
  78. {
  79. "function": "stream_get_line",
  80. "params": [
  81. "@mock-stream",
  82. 1024,
  83. "\r\n"
  84. ],
  85. "return": "user-agent: websocket-client-php"
  86. },
  87. {
  88. "function": "stream_get_meta_data",
  89. "params": [
  90. "@mock-stream"
  91. ],
  92. "return": {
  93. "timed_out": false,
  94. "blocked": true,
  95. "eof": false,
  96. "stream_type": "tcp_socket\/ssl",
  97. "mode": "r+",
  98. "unread_bytes": 115,
  99. "seekable": false
  100. }
  101. },
  102. {
  103. "function": "feof",
  104. "params": [
  105. "@mock-stream"
  106. ],
  107. "return": false
  108. },
  109. {
  110. "function": "stream_get_line",
  111. "params": [
  112. "@mock-stream",
  113. 1024,
  114. "\r\n"
  115. ],
  116. "return": "connection: Upgrade"
  117. },
  118. {
  119. "function": "stream_get_meta_data",
  120. "params": [
  121. "@mock-stream"
  122. ],
  123. "return": {
  124. "timed_out": false,
  125. "blocked": true,
  126. "eof": false,
  127. "stream_type": "tcp_socket\/ssl",
  128. "mode": "r+",
  129. "unread_bytes": 94,
  130. "seekable": false
  131. }
  132. },
  133. {
  134. "function": "feof",
  135. "params": [
  136. "@mock-stream"
  137. ],
  138. "return": false
  139. },
  140. {
  141. "function": "stream_get_line",
  142. "params": [
  143. "@mock-stream",
  144. 1024,
  145. "\r\n"
  146. ],
  147. "return": "upgrade: websocket"
  148. },
  149. {
  150. "function": "stream_get_meta_data",
  151. "params": [
  152. "@mock-stream"
  153. ],
  154. "return": {
  155. "timed_out": false,
  156. "blocked": true,
  157. "eof": false,
  158. "stream_type": "tcp_socket\/ssl",
  159. "mode": "r+",
  160. "unread_bytes": 74,
  161. "seekable": false
  162. }
  163. },
  164. {
  165. "function": "feof",
  166. "params": [
  167. "@mock-stream"
  168. ],
  169. "return": false
  170. },
  171. {
  172. "function": "stream_get_line",
  173. "params": [
  174. "@mock-stream",
  175. 1024,
  176. "\r\n"
  177. ],
  178. "return": "no key in upgrade request"
  179. },
  180. {
  181. "function": "stream_get_meta_data",
  182. "params": [
  183. "@mock-stream"
  184. ],
  185. "return": {
  186. "timed_out": false,
  187. "blocked": true,
  188. "eof": false,
  189. "stream_type": "tcp_socket\/ssl",
  190. "mode": "r+",
  191. "unread_bytes": 29,
  192. "seekable": false
  193. }
  194. },
  195. {
  196. "function": "feof",
  197. "params": [
  198. "@mock-stream"
  199. ],
  200. "return": false
  201. },
  202. {
  203. "function": "stream_get_line",
  204. "params": [
  205. "@mock-stream",
  206. 1024,
  207. "\r\n"
  208. ],
  209. "return": "sec-websocket-version: 13"
  210. },
  211. {
  212. "function": "stream_get_meta_data",
  213. "params": [
  214. "@mock-stream"
  215. ],
  216. "return": {
  217. "timed_out": false,
  218. "blocked": true,
  219. "eof": false,
  220. "stream_type": "tcp_socket\/ssl",
  221. "mode": "r+",
  222. "unread_bytes": 2,
  223. "seekable": false
  224. }
  225. },
  226. {
  227. "function": "feof",
  228. "params": [
  229. "@mock-stream"
  230. ],
  231. "return": false
  232. }
  233. ,
  234. {
  235. "function": "stream_get_line",
  236. "params": [
  237. "@mock-stream",
  238. 1024,
  239. "\r\n"
  240. ],
  241. "return": ""
  242. },
  243. {
  244. "function": "stream_get_meta_data",
  245. "params": [
  246. "@mock-stream"
  247. ],
  248. "return": {
  249. "timed_out": false,
  250. "blocked": true,
  251. "eof": false,
  252. "stream_type": "tcp_socket\/ssl",
  253. "mode": "r+",
  254. "unread_bytes": 0,
  255. "seekable": false
  256. }
  257. },
  258. {
  259. "function": "feof",
  260. "params": [
  261. "@mock-stream"
  262. ],
  263. "return": false
  264. }
  265. ]