server.accept-timeout.json 6.0 KB

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