test(e2e): add ingress module e2e test suite

Verifies hostname→endpoint routing at the reverse-proxy tunnel
entrypoint. A public gost runs a tunnel handler with an ingress
mapping example.local→tunnel-UUID and an HTTP entrypoint; an internal
client binds a reverse tunnel forwarding to the echo server. A request
with a mapped Host is routed through the tunnel to the echo server,
while an unmapped Host matches no ingress rule and is rejected.
This commit is contained in:
ginuerzh
2026-07-16 20:53:30 +08:00
parent 9355607ba7
commit 1fd69ac704
3 changed files with 150 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
# Internal client behind NAT: binds a reverse tunnel (tunnel.id matches the
# server's ingress endpoint) and forwards tunneled connections to the echo
# server. The tunnel server is reached via chain-0's tunnel connector.
#
# service-1 is a dummy TCP listener on a fixed port; the rtcp reverse-tunnel
# listener binds remotely through the chain and opens no local port, so this
# gives the e2e harness a stable port to wait on.
services:
- name: service-0
addr: ":0"
handler:
type: rtcp
listener:
type: rtcp
chain: chain-0
forwarder:
nodes:
- addr: tcp-echo:5678
- name: service-1
addr: ":8423"
handler:
type: http
listener:
type: tcp
chains:
- name: chain-0
hops:
- nodes:
- addr: gost-server:8421
connector:
type: tunnel
metadata:
tunnel.id: 6be39003-f4fa-49e4-a6ef-1997684d160e
dialer:
type: tcp
+23
View File
@@ -0,0 +1,23 @@
# Public-facing gost: a tunnel handler with an ingress table that maps the
# hostname example.local to a tunnel endpoint, plus an HTTP entrypoint on :8420.
# External requests to the entrypoint are routed by their Host header through
# the ingress table to the matching tunnel.
services:
- name: service-0
addr: ":8421"
handler:
type: tunnel
metadata:
entrypoint: ":8420"
ingress: ingress-0
listener:
type: tcp
ingresses:
- name: ingress-0
rules:
- hostname: example.local
endpoint: 6be39003-f4fa-49e4-a6ef-1997684d160e
log:
level: debug