mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-22 23:59:41 +08:00
Cover the port mappers, tlspr, dnspr, auto and the UDP data path
tcppm and udppm forward a port each, so test both directions of each: a request through the TCP mapper reaching its target, a datagram through the UDP one coming back answered, and a mapper whose rules deny the client answering nothing. tlspr takes its destination from the name in the handshake, so point that name at 127.0.0.1 with nsrecord and give the certificate the same name: the name then both chooses where the request goes and is what the client checks. dnspr answers from its cache, including the documented 0.0.0.0 record, which is handed out as an address rather than withheld. auto is asked to serve an HTTP proxy request, SOCKS4, SOCKS5 and a TLS handshake on one port, and to make nothing of a request that is none of them. Its protocols reach different places, so there are two origins. The SOCKS UDP association was only checked for the port it binds. Send datagrams through it as well, large and small, and check a second association gets its own port - and that one bound inside an intport range still relays. A UDP service has no socket to connect to, so readiness is found by asking until it answers rather than racing it.
This commit is contained in:
1 parent
cfc3c2bd7d
commit
daa0e36e41
8 files changed
+419
-3
No files matched your search
@@ -51,6 +51,11 @@ Assertions are `eq`, `ne`, `contains`, `not_contains`, `in_range`,
|
||||
`not_in_range`, plus `ok`, `fail` and `skip`. `harness.field()` and
|
||||
`int_field()` pull a single line out of an `echo` reply.
|
||||
|
||||
For services with no TCP port to connect to, `t.udp_echo()` starts an echo
|
||||
server, `t.udp_exchange()` sends a datagram, `t.wait_udp()` waits for a UDP
|
||||
service to start answering, `t.socks_udp()` carries one through a SOCKS
|
||||
association, and `t.dns_query()` asks a DNS server for an A record.
|
||||
|
||||
`t.certs()` generates a CA, a second unrelated CA, and a certificate for
|
||||
127.0.0.1, once per run and inside the run's temporary directory, so no key
|
||||
material lives in the tree. `t.https()`, `t.tls_proxy_http()` and
|
||||
|
||||
Reference in new issue
Block a user