xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 1 | <testcase> |
| 2 | <info> |
| 3 | <keywords> |
| 4 | WebSockets |
| 5 | </keywords> |
| 6 | </info> |
| 7 | |
| 8 | # |
| 9 | # Server-side |
| 10 | <reply> |
| 11 | <data nocheck="yes" nonewline="yes"> |
| 12 | HTTP/1.1 101 Switching to WebSockets
|
| 13 | Server: test-server/fake
|
| 14 | Upgrade: websocket
|
| 15 | Connection: Upgrade
|
| 16 | Something: else
|
| 17 | Sec-WebSocket-Accept: HkPsVga7+8LuxM4RGQ5p9tZHeYs=
|
| 18 |
|
| 19 | %hex[%89%00]hex% |
| 20 | </data> |
| 21 | # allow upgrade |
| 22 | <servercmd> |
| 23 | upgrade |
| 24 | </servercmd> |
| 25 | </reply> |
| 26 | |
| 27 | # |
| 28 | # Client-side |
| 29 | <client> |
| 30 | # require debug for the forced CURL_ENTROPY |
| 31 | <features> |
| 32 | debug |
| 33 | ws |
| 34 | </features> |
| 35 | <server> |
| 36 | http |
| 37 | </server> |
| 38 | <name> |
| 39 | WebSockets via callback (raw mode) + curl_ws_send() |
| 40 | </name> |
| 41 | <tool> |
| 42 | lib%TESTNUMBER |
| 43 | </tool> |
| 44 | <command> |
| 45 | ws://%HOSTIP:%HTTPPORT/%TESTNUMBER |
| 46 | </command> |
| 47 | </client> |
| 48 | |
| 49 | # |
| 50 | # Verify data after the test has been "shot" |
| 51 | <verify> |
| 52 | <protocol nocheck="yes" nonewline="yes"> |
| 53 | GET /%TESTNUMBER HTTP/1.1
|
| 54 | Host: %HOSTIP:%HTTPPORT
|
| 55 | User-Agent: webbie-sox/3
|
| 56 | Accept: */*
|
| 57 | Upgrade: websocket
|
| 58 | Connection: Upgrade
|
| 59 | Sec-WebSocket-Version: 13
|
| 60 | Sec-WebSocket-Key: NDMyMTUzMjE2MzIxNzMyMQ==
|
| 61 |
|
| 62 | %hex[%8a%00]hex% |
| 63 | </protocol> |
| 64 | </verify> |
| 65 | </testcase> |