From 3d0386f27ca66379acf50199e1d1298386eeeeb8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 May 2024 02:55:53 +0200 Subject: Adding upstream version 3.2.1. Signed-off-by: Daniel Baumann --- tests/pytests/rehandshake/tcproxy.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/pytests/rehandshake/tcproxy.c (limited to 'tests/pytests/rehandshake/tcproxy.c') diff --git a/tests/pytests/rehandshake/tcproxy.c b/tests/pytests/rehandshake/tcproxy.c new file mode 100644 index 0000000..87a6b4c --- /dev/null +++ b/tests/pytests/rehandshake/tcproxy.c @@ -0,0 +1,25 @@ +#include +#include "tcp-proxy.h" + +int main() +{ + struct proxy_ctx *proxy = proxy_allocate(); + if (!proxy) { + fprintf(stderr, "can't allocate proxy structure\n"); + return 1; + } + int res = proxy_init(proxy, "127.0.0.1", 54000, "127.0.0.1", 53001); + if (res) { + fprintf(stderr, "can't initialize proxy by given addresses\n"); + return res; + } + res = proxy_start_listen(proxy); + if (res) { + fprintf(stderr, "error starting listen, error code: %i\n", res); + return res; + } + res = proxy_run(proxy); + proxy_free(proxy); + return res; +} + -- cgit v1.2.3