コード例 #1
0
ファイル: ServerCommand.cs プロジェクト: stangelandcl/manos
        public void Run()
        {
            // Load the config.
            ManosConfig.Load();

            app = Loader.LoadLibrary <ManosApp> (ApplicationAssembly, Arguments);

            Console.WriteLine("Running {0} on port {1}.", app, Port);

            if (User != null)
            {
                SetServerUser(User);
            }

            var listenAddress = Manos.IO.IPAddress.Any;

            if (IPAddress != null)
            {
                listenAddress = Manos.IO.IPAddress.Parse(IPAddress);
            }

            AppHost.ListenAt(new Manos.IO.IPEndPoint(listenAddress, Port));
            if (SecurePort != null)
            {
                AppHost.InitializeTLS("NORMAL");
                AppHost.SecureListenAt(new Manos.IO.IPEndPoint(listenAddress, SecurePort.Value), CertificateFile, KeyFile);
                Console.WriteLine("Running {0} on secure port {1}.", app, SecurePort);
            }
            AppHost.Start(app);
        }
コード例 #2
0
        public void Index(IManosContext ctx)
        {
            ctx.Response.End(@"<html>
                                   <head><title>" + ManosConfig.Get("shorty.title") + @"</title></head>
                                   <body>
                                    <form method='POST' action='submit-link'>
                                     <input type='text' name='link' /><br />
                                     <input type='checkbox' name='show_info' /> Show me the info page, instead of redirecting.<br />
                                     <input type='submit' />
                                    </form>
                                   </body>
				  </html>"                );
        }
コード例 #3
0
        public void Run()
        {
            // Load the config.
            ManosConfig.Load();

            app = Loader.LoadLibrary <ManosApp> (ApplicationAssembly, Arguments);

            Console.WriteLine("Running {0} on port {1}.", app, Port);

            if (User != null)
            {
                SetServerUser(User);
            }
            if (IPAddress != null)
            {
                AppHost.IPAddress = System.Net.IPAddress.Parse(IPAddress);
            }

            AppHost.Port = Port;
            AppHost.Start(app);
        }