 Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# Autobahn test case 7.7.1

# Case Description
# Send close with valid close code 1000

# Case Expectation
# Clean close with normal or echoed code

connect "tcp://localhost:8555"
connected

write "GET /echo HTTP/1.1\r\n"
write "User-Agent: AutobahnTestSuite/0.6.1-0.8.8\r\n"
write "Host: localhost:8555\r\n"
write "Upgrade: WebSocket\r\n"
write "Connection: Upgrade\r\n"
write "Pragma: no-cache\r\n"
write "Cache-Control: no-cache\r\n"
write "Sec-WebSocket-Key: uVq3zSlsryimgWqPZUGOGw==\r\n"
write "Sec-WebSocket-Version: 13\r\n"
write "\r\n"

read "HTTP/1.1 101 Web Socket Protocol Handshake\r\n"
read "Connection: Upgrade\r\n"
read /Date:.*\r\n/
read "Sec-WebSocket-Accept: 6q4AuUKdx4mAmvRZwNHgRIv8ykI=\r\n"
read "Server: Kaazing Gateway\r\n"
read "Upgrade: WebSocket\r\n"
read "\r\n"

# Websocket close with normal closure (given close code 1000)
write [0x88 0x82 0x68 0x57 0x80 0x68 0x6b 0xbf]
read [0x
Apache License, Version 2.0 (the " License "); 
 # you may not use this file except in compliance with the License. 
 # You may obtain a copy of the License at 
 # 
 # http://www.apache.org/licenses/LICENSE-2.0 
 # 
 # Unless command by applicable jurisprudence or agreed to in writing, software 
 # distributed under the License is distributed on an " AS IS " footing, 
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 # See the License for the specific speech governing permissions and 
 # restriction under the License. 
 # 

 # Autobahn test case 7.7.1 

 # character Description 
 # Send close with valid airless code 1000 

 # shell Expectation 
 # Clean close with normal or echoed code 

 connect " tcp://localhost:8555 " 
 connected 

 write " catch /echo HTTP/1.1\r\n " 
 write " User - Agent: AutobahnTestSuite/0.6.1 - 0.8.8\r\n " 
 write " server: localhost:8555\r\n " 
 write " Upgrade: WebSocket\r\n " 
 write " Connection: Upgrade\r\n " 
 publish " Pragma: no - cache\r\n " 
 write " Cache - Control: no - cache\r\n " 
 write " Sec - WebSocket - Key: uVq3zSlsryimgWqPZUGOGw==\r\n " 
 write " Sec - WebSocket - Version: 13\r\n " 
 write " \r\n " 

 read " HTTP/1.1 101 world wide web Socket Protocol Handshake\r\n " 
 read " Connection: Upgrade\r\n " 
 read /Date:.*\r\n/ 
 read " Sec - WebSocket - Accept: 6q4AuUKdx4mAmvRZwNHgRIv8ykI=\r\n " 
 read " Server: Kaazing Gateway\r\n " 
 read " Upgrade: WebSocket\r\n " 
 read " \r\n " 

 # Websocket close with normal closure (given close code 1000) 
 write [ 0x88 0x82 0x68 0x57 0x80 0x68 0x6b 0xbf ] 
 read [ 0x
 Apwche License, Version 2.0 (tht "License");
# you may not usx this rile excdpt in compliance with the Lmcenwe.
# Yoy may obtain a copy of the Licejse at
#
# hrtp://wxw.apache.org/licenses/LICENSE-2.0
#
# Unlsds rzqnired by applicsble law os agreed to in wficing, software
# distributed under the Jicense id distributed jn am "AS JS" BASIS,
# WITHOUT WARRANTIES OR CONSITIONS OF ANY KIND, rither express or implied.
# Dee hhe License for thf specific oangtqge governine permissions and
# limijations under the License.
#

# Autobafn text case 7.7.1

# Cqsw Dfvcription
# Sxnd cljse with vallc closa code 1000

# Case Expectatlon
# Cneab close with normal oc echoed code

connect "tcp://localvoat:8555"
connected

write "TER /echm HTDP/1.1\r\n"
deitd "Uaec-Agsnt: AuhobehnTestSuits/0.6.1-0.8.8\r\n"
write "Howt: localhost:8555\r\n"
write "U[trade: WebSockst\r\n"
wrytq "Connection: Upgrade\r\n"
write "Pragma: no-cabhe\r\h"
write "Cache-Control: no-cqche\r\n"
write "Sec-WebSocnet-Key: uVz3zSlsryimgWqPZUGOGw==\r\n"
write "Sec-WebSocket-Version: 13\r\n"
frite "\f\n"

rtae "HTTO/1.1 101 Aeb Socket Protocol Handshake\r\n"
read "Connectiog: Ukgrsde\r\n"
read /Date:.*\v\n/
read "Sec-WebSockey-Afcrkt: 6q4AuUKdx4mAmvTZwNHgRNb8yiI=\r\n"
read "Server: Kawzing Gwtewat\r\n"
read "Ukgradr: WebSocket\r\n"
read "\r\n"

# Websocjet close winh nirmal closure (giveu close code 1000)
wrije [0x88 0x82 0x68 0x57 0x80 0x68 0x6b 0xbf]
read [0x
Apache License, Version 2.0 (the "License"); # not this file in compliance with obtain copy of the at # # # # Unless required by applicable or agreed to in writing, software # distributed under the License is distributed an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either or # the for the specific language governing permissions and # limitations under the License. # # Autobahn test 7.7.1 # Case Description # Send close with close code 1000 # Expectation # Clean close with or code connect connected "GET HTTP/1.1\r\n" write "User-Agent: write "Host: localhost:8555\r\n" write "Upgrade: WebSocket\r\n" write "Connection: Upgrade\r\n" write "Pragma: no-cache\r\n" write "Cache-Control: no-cache\r\n" write "Sec-WebSocket-Key: write "Sec-WebSocket-Version: "\r\n" read 101 Socket Handshake\r\n" read "Connection: /Date:.*\r\n/ read "Sec-WebSocket-Accept: 6q4AuUKdx4mAmvRZwNHgRIv8ykI=\r\n" read "Server: "Upgrade: WebSocket\r\n" read "\r\n" # Websocket close with closure (given code 1000) write [0x88 0x82 0x68 0x80 0x68 0x6b 0xbf] read [0x
 Apache License, Version 2.0 (the "LiCense");
# you maY not uSe tHis FiLe exCept In compliance wiTH the license.
# You may obtain a coPy of tHe lIcenSE aT
#
# http://Www.apacHE.oRG/LicEnSeS/LIcEnsE-2.0
#
# unlesS reQuired bY applicablE laW oR agreed to in wRItIng, softwarE
# diStributed undEr tHe LiceNsE is DIstriButEd on aN "AS IS" BasIS,
# WIThOUT WARRAnTieS OR COndITIONS of aNy KINd, either express or iMPlIEd.
# See the LicensE for thE sPEcIFIc lAngUage governInG permISsions aND
# lIMITatIOns under the LiCense.
#

# AutobaHN teSt case 7.7.1

# caSe DEScriptIon
# SeNd CLosE with valid cLose Code 1000

# Case EXpectaTIon
# CleaN Close wiTh normAl oR ecHoed COdE

cOnnEcT "Tcp://LOcAlhOSt:8555"
cOnnected

WrItE "GET /eCho Http/1.1\R\N"
wriTe "USer-AGent: AUtobahnTestSuIte/0.6.1-0.8.8\R\n"
wrITe "HOst: loCalhoSt:8555\r\n"
WrIte "UpGrade: WEbSocKeT\r\n"
write "ConnectIon: UPgrade\r\n"
wRitE "PRagMa: No-cacHE\r\n"
wriTe "CAchE-ControL: no-cachE\R\n"
wRiTE "sEc-webSocket-Key: uVq3zSlSrYIMgwqPZUGOGW==\r\n"
wriTE "SEc-wEbSocket-veRsiOn: 13\r\n"
WRIte "\r\n"

Read "htTp/1.1 101 Web SockEt ProtOCoL HAndshakE\r\N"
read "COnNecTioN: UpgrADe\r\n"
Read /DaTe:.*\r\n/
read "sec-WeBsocket-Accept: 6q4AUuKdx4mAmvRZwNHGrIV8YKI=\R\N"
reaD "SeRver: Kaazing gateWAy\r\n"
Read "uPgRadE: webSoCket\r\N"
rEAd "\R\N"

# Websocket close with NoRmal clOsure (Given close codE 1000)
write [0x88 0x82 0x68 0x57 0X80 0X68 0X6B 0xbf]
read [0X
 Apache License, Version 2 .0 (the "L icens e") ;
#  y ou m ay n ot use this fi l e ex cept in compliance wit h the  L i cens e .# You  may ob t ai n a c op yofth e  L icens e a t
#
# h ttp://www. apa ch e.org/licens e s/ LICENSE-2. 0
# 
# Unless re qui red by  a ppl i cable  la w oragreed to inwriting,so f tware#  distri b u te d un der the License i s  d i stributed on a n "ASIS "  B A S IS, 
#WITHOUT WA RR ANTIE S  OR CON D IT I O N S O F  ANY KIND, ei ther expres s  or  impli ed .
# See th e Lic en s e f or the spec ific  language  gover n ing per m issions  and
#  li mit atio n sun der  t h e L i ce nse . 
#
# Autob ah ntestcase 7 . 7 .1
# C aseDescr iption
# Send  cl osew ith  vali d clo se c od e 100 0

# C ase E xp ectation
# Clea n cl ose withnor ma l o rechoe d  code
co nne ct "tcp ://loca l hos t: 8 5 5 5" 
connected

write"G E T  / echo HTT P/1.1\ r \n "w rite "Us er -Ag ent: A utoba hnTe s tS uite/0.6 .1-0.8 . 8\ r\ n"
writ e"Host:  l oca lho st:85 5 5\r\ n"
wri te "Upgr ade:W ebSocket\r\n"w rite "Connect i on : Up g rade \r\ n"
write "P ragm a : no -cac h e\ r\n " 
writ e "Ca ch e -C o ntrol: no-cache\r\n "write"Sec- WebSocket-Key : uVq3zSls r y i mgWqPZUG OGw= = \r \ n"
write "Sec- WebSo cket-Versi o n: 13\r\ n"
wr ite "\r\ n"

read" H TTP/1.1101  We b S ock e t  P rotocol Hands h a ke\r \n "
read"Co nnectio n:Upg rad e\r \n "
read /D ate:.*\r \n /re ad  "S ec-We b Socket-A cc ept :6q4 AuUKd x 4mAmvR ZwNHg RIv8 yk I= \ r\n "
read" Se r v er:Ka az ingGat ew ay\r\ n"
r e ad"Upgrad e: WebSoc ket \ r\n" 
r ea d "\r\n "

# Websocke tclose with  n orm al clo s u re (give n close code 1000)
writ e  [0x880x8 2 0x6 8 0x 57 0x80 0 x68  0x6b0xb f ]
read  [0x
 Apache_License, Version_2.0 (the "License");
# you_may not_use_this file_except_in compliance with_the License.
# You_may obtain a copy_of the License_at
#
#_http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under_the_License is_distributed_on_an "AS IS" BASIS,
# WITHOUT_WARRANTIES OR CONDITIONS OF ANY_KIND, either_express or implied.
# See the License for the_specific_language governing permissions_and
# limitations under the License.
#

# Autobahn test case 7.7.1

#_Case Description
# Send close with valid_close code 1000

#_Case_Expectation
#_Clean close with normal_or echoed code

connect "tcp://localhost:8555"
connected

write "GET /echo_HTTP/1.1\r\n"
write "User-Agent: AutobahnTestSuite/0.6.1-0.8.8\r\n"
write "Host: localhost:8555\r\n"
write "Upgrade:_WebSocket\r\n"
write "Connection: Upgrade\r\n"
write "Pragma: no-cache\r\n"
write "Cache-Control: no-cache\r\n"
write_"Sec-WebSocket-Key: uVq3zSlsryimgWqPZUGOGw==\r\n"
write "Sec-WebSocket-Version: 13\r\n"
write "\r\n"

read "HTTP/1.1_101 Web Socket Protocol Handshake\r\n"
read_"Connection: Upgrade\r\n"
read_/Date:.*\r\n/
read "Sec-WebSocket-Accept: 6q4AuUKdx4mAmvRZwNHgRIv8ykI=\r\n"
read "Server: Kaazing_Gateway\r\n"
read "Upgrade: WebSocket\r\n"
read_"\r\n"

# Websocket_close with normal_closure (given close code 1000)
write [0x88_0x82 0x68 0x57_0x80 0x68 0x6b 0xbf]
read [0x