Beispiel #1
0
        static AuthenticatedWebServer()
        {
            var(publicKey, privateKey) = CryptoUtility.GenerateKeys();
            PrivateKey = privateKey;
            PublicKey  = publicKey;

            var rnd = new Random();

            BindingUri = new Uri(String.Format("http://127.0.0.1:{0}", rnd.Next(1025, 65534)));
        }
Beispiel #2
0
        public Server(String workspaceDirectory)
        {
            var logProvider = new LogProvider();

            logProvider.AddLogger(new ConsoleLogger(LogLevel.Verbose, new ConsoleLogFormatter()));

            this.WorkspaceDirectory    = workspaceDirectory;
            var(publicKey, privateKey) = CryptoUtility.GenerateKeys();
            this.PublicKey             = publicKey;

            var rnd = new Random();

            this.BindingUri = new Uri(String.Format("http://127.0.0.1:{0}", rnd.Next(1025, 65534)));
            this.WebServer  = new WebServer(this.BindingUri, this.WorkspaceDirectory, privateKey, logProvider);
        }