コード例 #1
0
        public DevServerManifestReader(DevServerContext context, DevServerBackchannelFactory backchannelFactory)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            if (backchannelFactory == null)
            {
                throw new ArgumentNullException(nameof(backchannelFactory));
            }

            backchannel = backchannelFactory.Create(context.ManifestUri);
            backchannel.DefaultRequestHeaders.Add("Connection", "keep-alive");
        }
コード例 #2
0
        public DevServerAssetPathRepository(
            DevServerContext context,
            DevServerManifestReader manifestReader,
            IHttpContextAccessor httpContextAccessor,
            ILogger <DevServerAssetPathRepository> logger)
        {
            this.context = context ??
                           throw new ArgumentNullException(nameof(context));

            this.manifestReader = manifestReader ??
                                  throw new ArgumentNullException(nameof(manifestReader));

            this.httpContextAccessor = httpContextAccessor ??
                                       throw new ArgumentNullException(nameof(httpContextAccessor));

            this.logger = logger ??
                          throw new ArgumentNullException(nameof(logger));
        }
        public DevServerReverseProxyMiddleware(
            DevServerContext context,
            DevServerBackchannelFactory backchannelFactory,
            RequestDelegate next)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            if (backchannelFactory == null)
            {
                throw new ArgumentNullException(nameof(backchannelFactory));
            }

            this.next          = next ?? throw new ArgumentNullException(nameof(next));
            this.devServerHost = context.DevServerHost;
            this.backchannel   = backchannelFactory.Create(context.DevServerUri);
        }