proxy/mucp: don't lookup routes if client using proxy (#1896)

This commit is contained in:
ben-toogood 2020-08-05 12:45:56 +01:00 committed by GitHub
parent eee91ed976
commit 38ec233350
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -367,6 +367,12 @@ func (p *Proxy) ServeRequest(ctx context.Context, req server.Request, rsp server
local = true
}
// if there is a proxy being used, e.g. micro network, we don't need to
// look up the routes since they'll be ignored by the client
if len(p.Client.Options().Proxy) > 0 {
return p.serveRequest(ctx, p.Client, service, endpoint, req, rsp)
}
// call a specific backend endpoint either by name or address
if len(p.Endpoint) > 0 {
// address:port