diff --git a/ColoryrServer/ASP/ColoryrServer.ASP.csproj b/ColoryrServer/ASP/ColoryrServer.ASP.csproj index e758f3b..c97f5f7 100644 --- a/ColoryrServer/ASP/ColoryrServer.ASP.csproj +++ b/ColoryrServer/ASP/ColoryrServer.ASP.csproj @@ -6,6 +6,8 @@ enable ..\..\build_out\ASP ColoryrWork.ico + embedded + x64 diff --git a/ColoryrServer/ASP/Program.cs b/ColoryrServer/ASP/Program.cs index f25f3ac..c6bfa61 100644 --- a/ColoryrServer/ASP/Program.cs +++ b/ColoryrServer/ASP/Program.cs @@ -171,10 +171,8 @@ public static void Main() public static X509Certificate2? Ssl(ConnectionContext? context, string? url) { - if (Ssls.TryGetValue(url, out var item)) - { + if (url != null && Ssls.TryGetValue(url, out var item)) return item; - } return DefaultSsl; } diff --git a/ColoryrServer/Core/ColoryrServer.Core.csproj b/ColoryrServer/Core/ColoryrServer.Core.csproj index 8943426..df55a49 100644 --- a/ColoryrServer/Core/ColoryrServer.Core.csproj +++ b/ColoryrServer/Core/ColoryrServer.Core.csproj @@ -7,6 +7,7 @@ false ..\..\build_out\Core + embedded diff --git a/README.md b/README.md index 9ac67a4..bbe00b2 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,9 @@ - 可以添加ssl证书(ASP模式) - 可以对接[ColorMirai](https://github.com/Coloryr/ColorMirai) QQ机器人 - 占用内存极少 +- 可以配置端口反向代理和域名反向代理 - 业务代码修改无需重启 +- 可以自己添加DLL库,并在端口文件中调用 [理论性能测试](./doc/test.md) diff --git a/doc/config.md b/doc/config.md index e8ab33b..3165f6c 100644 --- a/doc/config.md +++ b/doc/config.md @@ -6,18 +6,46 @@ ## 服务器核心配置文件 ```JSON { - //反向代理(效率略低) + //反向代理(效率极低) "Rotes": { "turn": { - "Url": "http://127.0.0.1/" + //目标地址 + "Url": "http://127.0.0.1/", + //添加的请求头 + "Heads": { + "Rote": "test" + } } }, //SSL模式,启用后会使用https "Ssl": false, - //SSL证书路径 - "SslLocal": ".\\xxx.pfx", - //SSL证书密码 - "SslPassword": "123456", + //SSL证书配置 + "Ssls": { + //默认的SSL证书 + "default": { + "SslLocal": "./test.sfx", + "SslPassword": "123456" + }, + //某个域名的SSL证书 + "www.xxx.xxx":{ + "SslLocal": "./www.xxx.xxx.sfx", + "SslPassword": "123456" + } + }, + //域名转发 + "UrlRotes": { + //目标域名 + "www.test.com": { + //目标地址 + "Url": "http://localhost:81/", + //添加的请求头 + "Heads": { + "Rote": "test" + } + } + }, + //是否启用反向代理 + "RoteEnable": false, //控制台输入无效 "NoInput": false, //Http服务器配置,可以添加监听数量 @@ -45,57 +73,58 @@ //Mysql配置 "Mysql": [ { - "Enable": false, - "IP": "127.0.0.1", - "Port": 3306, - "User": "root", - "Password": "MTIzNDU2", - "ConnCount": 50, - "TimeOut": 1000, - "Conn": "SslMode=none;Server={0};Port={1};User ID={2};Password={3};Charset=utf8;" + "Enable": false, + "IP": "127.0.0.1", + "Port": 3306, + "User": "root", + "Password": "MTIzNDU2", + "ConnCount": 50, + "TimeOut": 1000, + "Conn": "SslMode=none;Server={0};Port={1};User ID={2};Password={3};Charset=utf8;" } ], //MS sql设置 "MSsql": [ { - "Enable": false, - "IP": "127.0.0.1", - "User": "root", - "Password": "MTIzNDU2", - "ConnCount": 50, - "TimeOut": 1000, - "Conn": "Server={0};UID={1};PWD={2};" + "Enable": false, + "IP": "127.0.0.1", + "User": "root", + "Password": "MTIzNDU2", + "ConnCount": 50, + "TimeOut": 1000, + "Conn": "Server={0};UID={1};PWD={2};" } ], //Redis设置 "Redis": [ { - "Enable": false, - "IP": "127.0.0.1", - "Port": 6379, - "ConnCount": 20, - "TimeOut": 1000, - "Conn": "{0}:{1}" + "Enable": false, + "IP": "127.0.0.1", + "Port": 6379, + "ConnCount": 20, + "TimeOut": 1000, + "Conn": "{0}:{1}" } ], //Oracle配置 "Oracle": [ { - "Enable": false, - "IP": "127.0.0.1", - "Port": 0, - "User": "root", - "Password": "MTIzNDU2", - "ConnCount": 20, - "TimeOut": 1000, - "Conn": "User Id={2};Password={3};Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST={0})(PORT={1})))(CONNECT_DATA=(SERVICE_NAME=test)))" + "Enable": false, + "IP": "127.0.0.1", + "Port": 0, + "User": "root", + "Password": "MTIzNDU2", + "ConnCount": 20, + "TimeOut": 1000, + "Conn": "User Id={2};Password={3};Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST={0})(PORT={1})))(CONNECT_DATA=(SERVICE_NAME=test)))" } ], //编辑用户设置 "User": [ { - "Username": "Admin", - "Password": "4e7afebcfbae000b22c7c85e5560f89a2a0280b4" + "Username": "Admin", + //SHA1加密的密码 + "Password": "4e7afebcfbae000b22c7c85e5560f89a2a0280b4" } ], //不参与动态编译的dll