Пример #1
0
        private Uri BuildTargetUri(HttpRequest request)
        {
            Uri        targetUri = null;
            PathString remainingPath;

            if (request.Path.StartsWithSegments("/api", out remainingPath))
            {
                var address = _loadBalancer.GetLeastLoaded(request);
                targetUri = new Uri(address + "/api" + remainingPath);
            }

            return(targetUri);
        }