server.accept-timeout.json 6.2 KB

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