Esempio n. 1
0
        private void init(string hostname, System.Net.IPAddress address, int port, bool secure)
        {
            _hostname = hostname ?? address.ToString();
            _address  = address;
            _port     = port;
            _secure   = secure;

            _authSchemes = AuthenticationSchemes.Anonymous;
            _dnsStyle    = Uri.CheckHostName(hostname) == UriHostNameType.Dns;
            _listener    = new TcpListener(address, port);
            _logger      = new Logger();
            _services    = new WebSocketServiceManager(_logger);
            _sync        = new object();
        }
Esempio n. 2
0
        private void init(string hostname, System.Net.IPAddress address, int port, bool secure)
        {
            _hostname = hostname ?? convertToString(address);
            _address  = address;
            _port     = port;
            _secure   = secure;

            _listener = new HttpListener();
            _listener.Prefixes.Add(String.Format("http{0}://{1}:{2}/", secure ? "s" : "", _hostname, port));

            _logger   = _listener.Log;
            _services = new WebSocketServiceManager(_logger);
            _sync     = new object();

            _windows = WindowsDriveRegex.IsMatch(Directory.GetDirectoryRoot(Directory.GetCurrentDirectory()));
        }