This is a fork of https://github.com/google/tcpproxy/
For usage, see https://godoc.org/github.com/aviddiviner/tcpproxy/
Notable differences with this package:
-
The old
Matcher
type has been replaced with more of a "routing" matcher. The old type did a simple boolean match against the found hostname:// Matcher reports whether hostname matches the Matcher's criteria. type Matcher func(ctx context.Context, hostname string) bool
The new
Matcher
also returns itsTarget
(where an incoming matched connection is sent), allowing you to dynamically retarget based on the hostname:// Matcher checks whether a hostname matches its criteria and, if true, returns // the target where the incoming matched connection should be sent to. type Matcher func(ctx context.Context, hostname string) (t Target, ok bool)
-
Some new matchers have been added;
SuffixMatcher
which directs all hosts with the given domain suffix to a target, andConsulMatcher
which directs hosts based on DNS lookups in Consul of service names matching that host's subdomain.
-
The logic around ACME tls-sni-01 challenges (and
AddStopACMESearch
function) has been removed. This feature was found vulnerable to certain exploits1 and disabled by Let's Encrypt2.