diff --git a/proxy/grpc/grpc.go b/proxy/grpc/grpc.go index 2a401c0c..0caea36a 100644 --- a/proxy/grpc/grpc.go +++ b/proxy/grpc/grpc.go @@ -136,6 +136,10 @@ func (p *Proxy) ServeRequest(ctx context.Context, req server.Request, rsp server } } +func (p *Proxy) String() string { + return "grpc" +} + // NewProxy returns a new grpc proxy server func NewProxy(opts ...proxy.Option) proxy.Proxy { var options proxy.Options diff --git a/proxy/http/http.go b/proxy/http/http.go index 9b8b9188..d01bf038 100644 --- a/proxy/http/http.go +++ b/proxy/http/http.go @@ -188,6 +188,10 @@ func (p *Proxy) ServeRequest(ctx context.Context, req server.Request, rsp server } } +func (p *Proxy) String() string { + return "http" +} + // NewSingleHostProxy returns a router which sends requests to a single http backend func NewSingleHostProxy(url string) proxy.Proxy { return &Proxy{ diff --git a/proxy/mucp/mucp.go b/proxy/mucp/mucp.go index 98a3b7b6..0b059da3 100644 --- a/proxy/mucp/mucp.go +++ b/proxy/mucp/mucp.go @@ -521,6 +521,10 @@ func (p *Proxy) serveRequest(ctx context.Context, link client.Client, service, e } } +func (p *Proxy) String() string { + return "mucp" +} + // NewSingleHostProxy returns a proxy which sends requests to a single backend func NewSingleHostProxy(endpoint string) *Proxy { return &Proxy{ diff --git a/proxy/proxy.go b/proxy/proxy.go index 7fabae76..982ad3c6 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -13,6 +13,8 @@ type Proxy interface { ProcessMessage(context.Context, server.Message) error // ServeRequest handles inbound requests ServeRequest(context.Context, server.Request, server.Response) error + // Name of the proxy protocol + String() string } var (