Started working on FTP modules

This commit is contained in:
Alexandru Macocian
2020-04-05 13:58:14 +02:00
parent 941accb523
commit 72060f15dd
21 changed files with 1441 additions and 11 deletions
+16 -9
View File
@@ -1,4 +1,5 @@
using MTSC.Common.Http.ServerModules;
using MTSC.Common.Ftp.FtpModules;
using MTSC.Common.Http.ServerModules;
using MTSC.Common.WebSockets.ServerModules;
using MTSC.Exceptions;
using MTSC.Logging;
@@ -16,20 +17,26 @@ namespace MTSC_TestServer
{
static void Main(string[] args)
{
//X509Certificate2 certificate = new X509Certificate2("localhost.pfx", "psdsd");
Server server = new Server(443);
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(1024);
//EncryptionHandler encryptionHandler = new EncryptionHandler(rsa);
server
//.AddHandler(encryptionHandler)
.WithCertificate(new X509Certificate2("powershellcert.pfx", "123"))
.AddLogger(new ConsoleLogger())
.AddLogger(new DebugConsoleLogger())
.AddServerUsageMonitor(new TickrateEnforcer().SetTicksPerSecond(60))
.AddServerUsageMonitor(new TickrateEnforcer()
.SetTicksPerSecond(60)
.SetSilent(true))
.AddExceptionHandler(new ExceptionConsoleLogger())
//.AddHandler(new BroadcastHandler())
.AddHandler(new WebsocketHandler())
.AddHandler(new HttpHandler().AddHttpModule(new FileServerModule())
.AddHttpModule(new PostModule()))
//.AddHandler(new WebsocketHandler())
//.AddHandler(new HttpHandler().AddHttpModule(new FileServerModule())
// .AddHttpModule(new PostModule()))
.AddHandler(new FtpHandler()
.AddModule(new AuthenticationModule())
.AddModule(new SystModule())
.AddModule(new FileSystemModule()
.WithRootPath("src/"))
.AddModule(new QuitModule())
.AddModule(new UnknownCommandModule()))
.Run();
}