blob: 81ee3dea95cb5d631d3cbfececb758048b0c1e91 [file] [log] [blame]
Tim Duesterhusd1b15b62020-03-13 12:34:23 +01001varnishtest "Check that we are able to read a unique-id from PROXYv2"
2
3#REQUIRE_VERSION=2.2
4
5feature ignore_unknown_macro
6
7haproxy h1 -conf {
8 defaults
9 mode http
10 timeout connect 1s
11 timeout client 1s
12 timeout server 1s
13
14 frontend echo
15 bind "fd@${fe1}" accept-proxy
16 http-after-response set-header echo %[fc_pp_unique_id,hex]
17 http-request return status 200
18} -start
19
20client c1 -connect ${h1_fe1_sock} {
21 # PROXY v2 signature
22 sendhex "0d 0a 0d 0a 00 0d 0a 51 55 49 54 0a"
23 # version + PROXY
24 sendhex "21"
25 # TCP4
26 sendhex "11"
27 # length of the address (12) + length of the TLV (8)
28 sendhex "00 14"
29 # 127.0.0.1 42 127.0.0.1 1337
30 sendhex "7F 00 00 01 7F 00 00 01 00 2A 05 39"
31 # PP2_TYPE_UNIQUE_ID + length of the value + "12345"
32 sendhex "05 00 05 31 32 33 34 35"
33
34 txreq -url "/"
35 rxresp
36 expect resp.status == 200
37 expect resp.http.echo == "3132333435"
38} -run