| varnishtest "Health-checks: basic HTTP health-check though a socks4 proxy" |
| feature ignore_unknown_macro |
| # This scripts tests a simple HTTP health-checks though a socks4 proxy. |
| ## send socks4 response : |
| ## statut(1) : 0x5a (success) |
| sendhex "005A000000000000" |
| expect req.method == OPTIONS |
| expect req.proto == HTTP/1.0 |
| syslog S1 -level notice { |
| expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be1/srv succeeded, reason: Layer7 check passed.+code: 200.+check duration: [[:digit:]]+ms, status: 1/1 UP." |
| log ${S1_addr}:${S1_port} daemon |
| server srv ${s1_addr}:${s1_port} socks4 ${h1_socks_addr}:${h1_socks_port} check-via-socks4 check inter 1s rise 1 fall 1 |
| tcp-request inspect-delay 500ms |
| ## Accept socks4 request on 16 bytes : |
| tcp-request content accept if { req.len eq 16 } { req.payload(0,1) -m bin "04" } { req.payload(1,1) -m bin "01" } { req.payload(2,2),hex,hex2i eq ${s1_port} } { req.payload(4,4),hex,hex2i -m ip ${s1_addr} } { req.payload(8,8) -m bin "484150726F787900" } |
| tcp-request content reject |
| server srv ${socks_addr}:${socks_port} |