summaryrefslogtreecommitdiff
path: root/tcpproxy.go
diff options
context:
space:
mode:
Diffstat (limited to 'tcpproxy.go')
-rw-r--r--tcpproxy.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/tcpproxy.go b/tcpproxy.go
index 02b70f5..8c33604 100644
--- a/tcpproxy.go
+++ b/tcpproxy.go
@@ -81,6 +81,16 @@ type Proxy struct {
ListenFunc func(net, laddr string) (net.Listener, error)
}
+// Matcher reports whether hostname matches the Matcher's criteria.
+type Matcher func(ctx context.Context, hostname string) bool
+
+// equals is a trivial Matcher that implements string equality.
+func equals(want string) Matcher {
+ return func(_ context.Context, got string) bool {
+ return want == got
+ }
+}
+
// config contains the proxying state for one listener.
type config struct {
routes []route