1#!/bin/sh
2
3. hitch_test.sh
4
5BACKENDPORT=$(expr $LISTENPORT + 1500)
6
7parse_proxy_v2 $BACKENDPORT >proxy.dump &
8
9start_hitch \
10	--backend=[127.0.0.1]:$BACKENDPORT \
11	--frontend="[localhost]:$LISTENPORT" \
12	--write-proxy-v2 \
13	--alpn-protos="h2,h2-14,http/1.1" \
14	${CERTSDIR}/site1.example.com
15
16sleep 0.1
17
18# If you have nghttp installed, you can try it instead of openssl s_client:
19# nghttp -v "https://localhost:$LISTENPORT"
20
21s_client -tls1_2 -nextprotoneg 'h2-14' >s_client.dump
22
23! grep ERROR proxy.dump
24
25run_cmd grep -q h2-14 proxy.dump
26run_cmd grep -q "ALPN extension" proxy.dump
27