client.connect-headers.json 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. [
  2. {
  3. "function": "stream_context_create",
  4. "params": [],
  5. "return": "@mock-stream-context"
  6. },
  7. {
  8. "function": "stream_socket_client",
  9. "params": [
  10. "tcp:\/\/localhost:8000",
  11. null,
  12. null,
  13. 5,
  14. 4,
  15. "@mock-stream-context"
  16. ],
  17. "return": "@mock-stream"
  18. },
  19. {
  20. "function": "get_resource_type",
  21. "params": [
  22. "@mock-stream"
  23. ],
  24. "return": "stream"
  25. },
  26. {
  27. "function": "stream_set_timeout",
  28. "params": [
  29. "@mock-stream",
  30. 5
  31. ],
  32. "return": true
  33. },
  34. {
  35. "function": "fwrite",
  36. "params": [
  37. "@mock-stream"
  38. ],
  39. "return-op": "key-save",
  40. "return": 255
  41. },
  42. {
  43. "function": "stream_get_line",
  44. "params": [
  45. "@mock-stream",
  46. 1024,
  47. "\r\n\r\n"
  48. ],
  49. "return-op": "key-respond",
  50. "return": "HTTP\/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: {key}"
  51. },
  52. {
  53. "function": "fwrite",
  54. "params": [
  55. "@mock-stream"
  56. ],
  57. "return": 13
  58. }
  59. ]