xref: /curl/tests/data/test2304 (revision f2fa4112)
1<testcase>
2<info>
3<keywords>
4WebSockets
5</keywords>
6</info>
7
8#
9# Sends a PING + a 5 byte hello TEXT
10<reply>
11<data nocheck="yes" nonewline="yes">
12HTTP/1.1 101 Switching to WebSockets swsclose
13Server: test-server/fake
14Upgrade: websocket
15Connection: Upgrade
16Something: else
17Sec-WebSocket-Accept: HkPsVga7+8LuxM4RGQ5p9tZHeYs=
18
19%hex[%89%00%81%05hello]hex%
20</data>
21# allow upgrade
22<servercmd>
23upgrade
24</servercmd>
25</reply>
26
27#
28# Client-side
29<client>
30# require debug for the forced CURL_ENTROPY
31<features>
32debug
33ws
34</features>
35<server>
36http
37</server>
38<name>
39WebSockets curl_ws_recv() with closed connection
40</name>
41<tool>
42lib%TESTNUMBER
43</tool>
44<command>
45ws://%HOSTIP:%HTTPPORT/%TESTNUMBER
46</command>
47</client>
48
49#
50# PONG with no data and the 32 bit mask
51#
52<verify>
53<protocol nocheck="yes" crlf="yes">
54GET /%TESTNUMBER HTTP/1.1
55Host: %HOSTIP:%HTTPPORT
56User-Agent: websocket/2304
57Accept: */*
58Upgrade: websocket
59Connection: Upgrade
60Sec-WebSocket-Version: 13
61Sec-WebSocket-Key: NDMyMTUzMjE2MzIxNzMyMQ==
62
63</protocol>
64
65# This test used to check that "connection closed" was output, but
66# that is flaky since the outgoing PING just before might fail already
67# and then the test exists before the output gets to be written
68</verify>
69</testcase>
70