summaryrefslogtreecommitdiffstats
path: root/debian/vendor-h2o/t/50reverse-proxy-proxy-protocol.t
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 02:49:40 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 02:49:40 +0000
commitc96f16e8103783f6b98d9f844ea3a7f2195e4834 (patch)
tree479bef5e7eb5d4f04ba171931c8b47335734e161 /debian/vendor-h2o/t/50reverse-proxy-proxy-protocol.t
parentMerging upstream version 1.9.4. (diff)
downloaddnsdist-c96f16e8103783f6b98d9f844ea3a7f2195e4834.tar.xz
dnsdist-c96f16e8103783f6b98d9f844ea3a7f2195e4834.zip
Adding debian version 1.9.4-1.debian/1.9.4-1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/vendor-h2o/t/50reverse-proxy-proxy-protocol.t')
-rw-r--r--debian/vendor-h2o/t/50reverse-proxy-proxy-protocol.t55
1 files changed, 0 insertions, 55 deletions
diff --git a/debian/vendor-h2o/t/50reverse-proxy-proxy-protocol.t b/debian/vendor-h2o/t/50reverse-proxy-proxy-protocol.t
deleted file mode 100644
index 0bb1a82..0000000
--- a/debian/vendor-h2o/t/50reverse-proxy-proxy-protocol.t
+++ /dev/null
@@ -1,55 +0,0 @@
-use strict;
-use warnings;
-use IO::Socket::INET;
-use Test::TCP;
-use Net::EmptyPort qw(check_port empty_port);
-use Test::More;
-use Scope::Guard qw(guard);
-use t::Util;
-
-my $upstream_port = empty_port();
-
-my $listen = IO::Socket::INET->new(
- LocalAddr => '127.0.0.1',
- LocalPort => $upstream_port,
- Listen => 5,
-) or die "failed to listen to 127.0.0.1:$upstream_port:$!";
-
-my $upstream_guard = do {
- my $pid = fork;
- die "fork failed:$!"
- unless defined $pid;
- if ($pid == 0) {
- # server process
- while (1) {
- if (my $conn = $listen->accept) {
- sysread $conn, my $buf, 4096;
-print STDERR "**** $buf";
- syswrite $conn, "HTTP/1.1 200 OK\r\nconnection: close\r\n\r\n$buf";
-print STDERR "**** yeoh";
- $conn->close;
- }
- }
- }
- guard {
- kill 'TERM', $pid;
- };
-};
-
-my $server = spawn_h2o(<< "EOT");
-hosts:
- default:
- paths:
- "/":
- proxy.reverse.url: http://127.0.0.1:$upstream_port/
- proxy.proxy-protocol: ON
- proxy.timeout.keepalive: 0
-EOT
-
-run_with_curl($server, sub {
- my ($proto, $port, $curl_cmd) = @_;
- my $resp = `$curl_cmd --silent $proto://127.0.0.1:$port/hello`;
- like $resp, qr{^PROXY TCP4 127\.0\.0\.1 127\.0\.0\.1 [0-9]{1,5} $port\r\nGET /hello HTTP/1\.}is;
-});
-
-done_testing;