59 lines
1.4 KiB
JSON
59 lines
1.4 KiB
JSON
[
|
|
{
|
|
"function": "stream_context_create",
|
|
"params": [],
|
|
"return": "@mock-stream-context"
|
|
},
|
|
{
|
|
"function": "stream_socket_client",
|
|
"params": [
|
|
"tcp:\/\/localhost:80",
|
|
null,
|
|
null,
|
|
5,
|
|
4,
|
|
"@mock-stream-context"
|
|
],
|
|
"return": "@mock-stream"
|
|
},
|
|
{
|
|
"function": "get_resource_type",
|
|
"params": [
|
|
"@mock-stream"
|
|
],
|
|
"return": "stream"
|
|
},
|
|
{
|
|
"function": "stream_set_timeout",
|
|
"params": [
|
|
"@mock-stream",
|
|
5
|
|
],
|
|
"return": true
|
|
},
|
|
{
|
|
"function": "fwrite",
|
|
"params": [
|
|
"@mock-stream",
|
|
"GET /my/mock/path HTTP/1.1\r\nHost: localhost:80\r\nUser-Agent: websocket-client-php\r\nConnection: Upgrade\r\nUpgrade: websocket\r\nSec-WebSocket-Key: {key}\r\nSec-WebSocket-Version: 13\r\n\r\n"
|
|
],
|
|
"input-op": "key-save",
|
|
"return": 224
|
|
},
|
|
{
|
|
"function": "fgets",
|
|
"params": [
|
|
"@mock-stream",
|
|
1024
|
|
],
|
|
"return-op": "key-respond",
|
|
"return": "HTTP\/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: {key}\r\n\r\n"
|
|
},
|
|
{
|
|
"function": "fwrite",
|
|
"params": [
|
|
"@mock-stream"
|
|
],
|
|
"return": 13
|
|
}
|
|
] |