예제 #1
0
        public static Uri ToUri(this ProxyServerOptions options)
        {
            int portNumber = 80;

            int.TryParse(options.Port, out portNumber);
            UriBuilder uriBuilder = new UriBuilder(options.Scheme, options.Host, portNumber);

            return(uriBuilder.Uri);
        }
예제 #2
0
        public static IOptions <ProxyOptions> ToProxyOptions(this ProxyServerOptions options)
        {
            ProxyOptions proxyOptions = new ProxyOptions()
            {
                Host   = options.Host,
                Port   = options.Port,
                Scheme = options.Scheme
            };

            return(Options.Create(proxyOptions));
        }