Beispiel #1
0
 static void Main(string[] args)
 {
     //Console.WriteLine("Starting in: \n " + System.Environment.CurrentDirectory);
     //Console.WriteLine("--------------------------------------------------------------------------------");
     PluginManager newPlugin = new PluginManager();
     Server neuerServer = new Server(ref newPlugin);
     Console.WriteLine("Server started...");
 }
Beispiel #2
0
 public DSTDContext(Server server, string requestHeader, Action<Page, Guid> g, Action<Guid, Dictionary<string, object>, Dictionary<string, object>> o, Page.GetApplication p)
 {
     OnGrabSession += g;
     myServer = server;
     OnSetSession += o;
     DSTDQuery query = new DSTDQuery(getURL(requestHeader));
     XmlDocument doc = getXML(requestHeader);
     Request = new DSTDRequest(this,query, doc,p);
     Request.Start();
 }
        public WorkingProcess(Server webServer, Stream stream, ConnectionInformation ci, 
			CoreSessionEventHandler onSessionStartHandler, 
			CoreAuthenticationEventHandler onAuthenticateHandler)
        {
            this.webServer = webServer;
            this.stream = stream;
            this.ci = ci;
            OnSessionStartHandler = onSessionStartHandler;
            OnAuthenticateHandler = onAuthenticateHandler;
            ms = new MemoryStream();
            outputStream = new StringBuilder();
        }
Beispiel #4
0
        public static void BeforeClass()
        {
            //設定ファイルの退避と上書き
            _op = new TmpOption("WebServerTest","WebServerTest.ini");
            var kernel = new Kernel();
            var option = kernel.ListOption.Get("Web-localhost:88");
            Conf conf = new Conf(option);

            //サーバ起動
            _v4Sv = new Server(kernel, conf, new OneBind(new Ip(IpKind.V4Localhost), ProtocolKind.Tcp));
            _v4Sv.Start();

            _v6Sv = new Server(kernel, conf, new OneBind(new Ip(IpKind.V6Localhost), ProtocolKind.Tcp));
            _v6Sv.Start();
        }
Beispiel #5
0
        static void Main()
        {
            //WebServer.Security.CertificateManager.CreateCertificate("CN=localhost", new CertificateConfig
            //	{ FilePath=@"D:\cert.pfx", IsEnabled=true, Password = "******"});

            //return;

            var web = new Server(IPAddress.Any, int.Parse(ConfigurationManager.AppSettings["port"]));
            web.ResolveDnsNames = true;
            web.UseSsl = true;
            web.SetCertificatePath(@"d:\cert.pfx", "111");
            web.RequestRouter.Add(new RouteEntry("/scripts", typeof(ImagePage)));
            web.RequestRouter.Add(new RouteEntry("/", typeof(HtmlPage)));
            web.AuthenticationMethod = AuthenticationMethod.Digest;
            web.AuthenticationEvent += delegate(object sender, AuthenticationEventArgs e) { e.Accept = true;
                                                                                          	e.Password = "******";
            };
            web.Start();
            Console.WriteLine("Web server started at port: " + ConfigurationManager.AppSettings["port"]);
            Console.WriteLine("Press any key to stop");
            Console.ReadKey(true);
            web.Stop();
        }
Beispiel #6
0
 static void Main(string[] args)
 {
     Server server = new Server(645);
 }