test(e2e): add resolver module e2e test suite

Verifies that a configured resolver drives the proxy's outbound DNS
resolution. A gost HTTP proxy uses a resolver whose only nameserver is a
test responder answering echo.test with the real echo server IP and
NXDOMAIN for everything else. A request to echo.test is resolved by the
custom resolver and reaches the echo server; an unmapped host fails to
resolve. Adds a parametrized DNS responder script and container helper.
This commit is contained in:
ginuerzh
2026-07-16 20:53:30 +08:00
parent 1fd69ac704
commit 20f1e4a0b9
4 changed files with 219 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
# HTTP proxy whose outbound dialing uses a custom resolver. The resolver's
# only nameserver is the test DNS responder, which answers echo.test with the
# real echo server IP and NXDOMAIN for everything else. A request to
# echo.test:5678 is therefore resolved by the custom resolver and reaches the
# echo server; a request to an unmapped host fails to resolve.
services:
- name: proxy
addr: ":8080"
resolver: resolver-0
handler:
type: http
listener:
type: tcp
resolvers:
- name: resolver-0
nameservers:
- addr: dns-responder:5353
timeout: 3s