Example #1
0
        static void Main(string[] args)
        {
            //var loadedAssemblies = AppDomain.CurrentDomain.GetAssemblies().ToList();

            //loadedAssemblies
            //    .SelectMany(x => x.GetReferencedAssemblies())
            //    .Distinct()
            //    .Where(y => loadedAssemblies.Any((a) => a.FullName == y.FullName) == false)
            //    .ToList()
            //    .ForEach(x => loadedAssemblies.Add(AppDomain.CurrentDomain.Load(x)));
            //typeof(Program).Assembly.GetReferencedAssemblies().Distinct()
            //    .Where(y => loadedAssemblies.Any((a) => a.FullName == y.FullName) == false)
            //    .ToList()
            //    .ForEach(x => loadedAssemblies.Add(AppDomain.CurrentDomain.Load(x)));


            //var containerBuilder = new ContainerBuilder();
            //var hostBuilder = new ApplicationServerBuilder(containerBuilder)
            //.LoadServices(new[] { "IServices", "Services" })
            //.UseLog4netLogger(new JimuLog4netOptions { EnableConsoleLog = true })
            ////.UseHttpForTransfer("127.0.0.1", 8007)// http server ip and port,becareful the firewall blocker
            //.UseConsulForDiscovery(new Jimu.Server.Discovery.ConsulIntegration.ConsulOptions("127.0.0.1", 8500, "JimuService-", "127.0.0.1:8009"))
            //.UseDotNettyForTransfer(new Jimu.Server.Transport.DotNetty.DotNettyOptions("127.0.0.1", 8009))
            //                             .UseJoseJwtForOAuth<DotNettyAddress>(new Jimu.Server.Auth.JwtAuthorizationOptions
            //                             {
            //                                 ServerIp = "127.0.0.1",
            //                                 ServerPort = 8009,
            //                                 SecretKey = "test",
            //                                 ExpireTimeSpan = new TimeSpan(1, 0, 0),
            //                                 TokenEndpointPath = "token",
            //                                 ValidateLifetime = true,
            //                                 CheckCredential = o =>
            //                                 {
            //                                     if (o.UserName == "admin" && o.Password == "admin")
            //                                     {
            //                                         o.AddClaim("department", "IT部");
            //                                     }
            //                                     else
            //                                     {
            //                                         o.Rejected("401", "acount or password incorrect");
            //                                     }
            //                                 }
            //                             })
            ;
            //using (var host = hostBuilder.Build())
            //{
            //    //InitProxyService();
            //    Console.WriteLine("haha");
            //    host.Run();
            //    Console.ReadLine();
            //}

            ApplicationServer.Run();
            Console.ReadLine();
        }
Example #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Auth Server starting ...");
            //var containerBuilder = new ContainerBuilder();
            //var builder = new ApplicationServerBuilder(containerBuilder);
            //using (var hostJimu = builder.Build())
            //{
            //    hostJimu.Run();
            //}

            ApplicationServer.Run();
            Console.ReadLine();
        }
Example #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            //var containerBuilder = new ContainerBuilder();
            //var builder = new ApplicationServerBuilder(containerBuilder)
            //.UseLog4netLogger(new JimuLog4netOptions
            //{
            //    EnableConsoleLog = true
            //})
            ////.LoadServices(new[] { "IServices", "Services" })
            //.LoadServices("services")
            //.UseDotNettyForTransfer(new Jimu.Server.Transport.DotNetty.DotNettyOptions("127.0.0.1", 8005), server => { })
            //.UseConsulForDiscovery(new Jimu.Server.Discovery.ConsulIntegration.ConsulOptions("127.0.0.1", 8500, "JimuService,hello", "127.0.0.1:8005"))
            //.UseJoseJwtForOAuth<DotNettyAddress>(new Jimu.Server.Auth.JwtAuthorizationOptions
            //{
            //    ServerIp = "127.0.0.1",
            //    ServerPort = 8005,
            //    SecretKey = "test",
            //    ExpireTimeSpan = new TimeSpan(1, 0, 0),
            //    TokenEndpointPath = "token",
            //    ValidateLifetime = true,
            //    CheckCredential = o =>
            //    {
            //        if (o.UserName == "admin" && o.Password == "admin")
            //        {
            //            o.AddClaim("department", "IT部");
            //        }
            //        else
            //        {
            //            o.Rejected("401", "acount or password incorrect");
            //        }
            //    }
            //})
            ;
            //using (var hostJimu = builder.Build())
            //{
            //    hostJimu.Run();
            //    Console.ReadLine();
            //}

            ApplicationServer.Run();
            Console.ReadLine();
        }
Example #4
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            //var containerBuilder = new ContainerBuilder();
            //var builder = new ApplicationServerBuilder(containerBuilder)
            //    //.UseLog4netLogger(new JimuLog4netOptions
            //    //{
            //    //    EnableConsoleLog = true
            //    //})
            //    //.LoadServices(new[] { "IServices", "Services" })
            //    //.UseHttpForTransfer(new Jimu.Server.Transport.Http.HttpOptions("127.0.0.1", 8006))
            //    ;
            //using (var hostJimu = builder.Build())
            //{
            //    hostJimu.Run();
            //}

            ApplicationServer.Run();
        }
Example #5
0
 static void Main(string[] args)
 {
     ApplicationServer.Run();
     Console.ReadLine();
 }