コード例 #1
0
ファイル: WebAppServer.cs プロジェクト: jkells/WebAppHost
 /// <summary>
 /// Create an instance of <see cref="WebAppServer"/>.
 /// </summary>
 /// <param name="urlReservation">
 /// The URL reservation to listen on. This string is similar to a URL, but the
 /// hostname may be a strong wildcard ('+') or a weak wildcard ('*'). E.g. "http://+:8080/".
 /// </param>
 public WebAppServer(string urlReservation)
 {
     _urlRegex = new Regex("^" + urlReservation.Replace("*", ".*?").Replace("+", ".*?"), RegexOptions.IgnoreCase);
     _listener = new HttpListener();
     _listener.Prefixes.Add(urlReservation);
     _disconnectHandler = new DisconnectHandler(_listener);
     var uri = new Uri(urlReservation.Replace("*", "localhost").Replace("+", "localhost"));
     _webAppConfiguration = new WebAppConfiguration(uri);
     StaticFiles = new StaticFileSpecCollection();
 }
コード例 #2
0
ファイル: WebAppServer.cs プロジェクト: jbdk/WebAppHost
        /// <summary>
        /// Create an instance of <see cref="WebAppServer"/>.
        /// </summary>
        /// <param name="urlReservation">
        /// The URL reservation to listen on. This string is similar to a URL, but the
        /// hostname may be a strong wildcard ('+') or a weak wildcard ('*'). E.g. "http://+:8080/".
        /// </param>
        public WebAppServer(string urlReservation)
        {
            _urlRegex = new Regex("^" + urlReservation.Replace("*", ".*?").Replace("+", ".*?"), RegexOptions.IgnoreCase);
            _listener = new HttpListener();
            _listener.Prefixes.Add(urlReservation);
            _disconnectHandler = new DisconnectHandler(_listener);
            var uri = new Uri(urlReservation.Replace("*", "localhost").Replace("+", "localhost"));

            _webAppConfiguration = new WebAppConfiguration(uri);
            StaticFiles          = new StaticFileSpecCollection();
        }
コード例 #3
0
ファイル: WebApiServer.cs プロジェクト: jkells/WebAppHost
 public WebApiServer(WebAppConfiguration config)
     : base(config)
 {
     _config = config;
 }