Skip to content

Commit

Permalink
Merge pull request #10 from libxengine/develop
Browse files Browse the repository at this point in the history
V1.7.0.1001 Merge
  • Loading branch information
xengine-qyt authored Jan 4, 2024
2 parents c64d7f3 + ff371e6 commit 8ce38f2
Show file tree
Hide file tree
Showing 32 changed files with 209 additions and 224 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
XEngine_ProxyServer V1.7.0.1001

增加:转发协议支持用户验证了
修改:用户验证从本地用户验证修改为http用户验证
修改:http转发包协议现在有code和msg字段了
修改:ModuleSession_Forward_Get是否登录处理
修改:转发列表和绑定协议错误处理方法
修改:转发协议请求必须登录了
修正:套接字验证类型不正确
删除:SOCKS和TUNNEL代理启动参数支持
删除:解绑协议支持,因为不会被使用到

added:forward user verifacation supported
modify:user verifacation modify to http pass from local user
modify:http forward packet protocol have code and msg field
modify:ModuleSession_Forward_Get supported addr whether login
modify:forward list and bind protocol error process way
modify:forward must be login now
fixed:socks ver type is incorrent
delete:socks and tunnel start parament supported
delete:unbind protocol,because that does not work
======================================================================================
XEngine_ProxyServer V1.6.0.1001

增加:数据转发解绑协议支持
Expand Down
2 changes: 1 addition & 1 deletion README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This software is a standard proxy server that supports Socks5 and HTTP tunnel pr
this software support following features
1. SOCKS5 proxy
2. Tunnel proxy
3. forward proxy
3. TCP forward proxy
4. support Permission Validation
5. operator log
6. encrypt Communication(planning)
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ c c++ Socks5 Proxy Service,HTTP Tunnel Proxy Service,tcp forward service
此软件是一款标准的代理服务器,支持Socks5和HTTP的隧道代理
## 软件特性
此软件支持以下特性
1. SOCKS5代理
2. Tunnel代理
3. 数据转发服务
4. 权限验证
1. SOCKS5代理
2. Tunnel代理
3. TCP数据转发服务
4. 权限验证
5. 操作日志
6. 加密通信(planning)
7. 负载均衡(planning)
8. 自定义证书代理协议(planning)
9. 多级代理(planning)
6. 加密通信(planning)
7. 负载均衡(planning)
8. 自定义证书代理协议(planning)
9. 多级代理(planning)

## 安装教程

Expand Down Expand Up @@ -87,11 +87,11 @@ make FLAGS=CleanAll 清理编译

## 开发计划
透传代理
转发代理支持权限和确认
支持加密代理
转发代理绑定解绑支持附加用户信息
转发代理绑定支持拒绝
转发代理支持用户验证
支持UDP转发代理
性能优化

## 关注我们
如果你觉得这个软件对你有帮助,请你给我们一个START吧
Expand Down
Binary file modified XEngine_Docment/Docment_en.docx
Binary file not shown.
Binary file modified XEngine_Docment/Docment_zh.docx
Binary file not shown.
2 changes: 0 additions & 2 deletions XEngine_Release/XEngine_Config/UserList.txt

This file was deleted.

5 changes: 3 additions & 2 deletions XEngine_Release/XEngine_Config/XEngine_Config.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@
"tszLogFile": "./XEngine_Log/XEngine_ProxyServiceApp.log"
},
"XAuth": {
"bAuth": 0,
"tszAuthFile": "./XEngine_Config/UserList.txt"
"bAuth": false,
"tszAuthUrl": ""
},
"XVer": [
"1.7.0.1001 Build20240104",
"1.6.0.1001 Build20230817",
"1.5.1.1001 Build20230426",
"1.5.0.1001 Build20230202",
Expand Down
6 changes: 1 addition & 5 deletions XEngine_Source/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ PLATFORM=linux
FLAGS=
#要编译的模块
THIRDPART_MODULE_JSONCPP = ./XEngine_ThirdPart/jsoncpp

MODULE_CONFIGURE_PATH = ./XEngine_ModuleConfigure
MODULE_AUTHORIZE_PATH = ./XEngine_ModuleAuthorize
MODULE_PROTOCOL_PATH = ./XEngine_ModuleProtocol
MODULE_SESSION_PATH = ./XEngine_ModuleSession
APP_SERVICE_PATH = ./XEngine_ServiceApp

XENGINE_MODULES = libjsoncpp.so libXEngine_ModuleConfigure.so libXEngine_ModuleAuthorize.so libXEngine_ModuleProtocol.so libXEngine_ModuleSession.so XEngine_ServiceApp.exe
XENGINE_MODULES = libjsoncpp.so libXEngine_ModuleConfigure.so libXEngine_ModuleProtocol.so libXEngine_ModuleSession.so XEngine_ServiceApp.exe

.PHONY:MakeAll
MakeAll:$(XENGINE_MODULES)
Expand All @@ -21,8 +19,6 @@ libjsoncpp.so:

libXEngine_ModuleConfigure.so:
make -C $(MODULE_CONFIGURE_PATH) PLATFORM=$(PLATFORM) $(FLAGS)
libXEngine_ModuleAuthorize.so:
make -C $(MODULE_AUTHORIZE_PATH) PLATFORM=$(PLATFORM) $(FLAGS)
libXEngine_ModuleProtocol.so:
make -C $(MODULE_PROTOCOL_PATH) PLATFORM=$(PLATFORM) $(FLAGS)
libXEngine_ModuleSession.so:
Expand Down
2 changes: 1 addition & 1 deletion XEngine_Source/VSCopy-Debug.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_ManagePool.dll" "./"
copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_NetXApi.dll" "./"

copy /y "D:\XEngine\XEngine_SourceCode\Debug\NetHelp_APIHelp.dll" "./"
copy /y "D:\XEngine\XEngine_SourceCode\Debug\NetHelp_APIClient.dll" "./"
copy /y "D:\XEngine\XEngine_SourceCode\Debug\XClient_Socket.dll" "./"

copy /y "D:\XEngine\XEngine_SourceCode\Debug\HelpComponents_XLog.dll" "./"
copy /y "D:\XEngine\XEngine_SourceCode\Debug\HelpComponents_Packets.dll" "./"
copy /y "D:\XEngine\XEngine_SourceCode\Debug\RfcComponents_ProxyProtocol.dll" "./"

copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_ProcFile.dll" "./"
copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_SystemApi.dll" "./"
29 changes: 13 additions & 16 deletions XEngine_Source/VSCopy-x64.bat
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
copy /y "%XEngine_Lib64%\x64\XEngine_BaseLib\XEngine_BaseLib.dll" "./"
copy /y "%XEngine_Lib64%\x64\XEngine_BaseLib\XEngine_Algorithm.dll" "./"
copy /y "%XEngine_Lib64%\x64\XEngine_Core\XEngine_Core.dll" "./"
copy /y "%XEngine_Lib64%\x64\XEngine_Core\XEngine_OPenSsl.dll" "./"
copy /y "%XEngine_Lib64%\x64\XEngine_Core\XEngine_ManagePool.dll" "./"
copy /y "%XEngine_Lib64%\x64\XEngine_Core\XEngine_NetXApi.dll" "./"
copy /y "%XEngine_Lib64%\XEngine_BaseLib\XEngine_BaseLib.dll" "./"
copy /y "%XEngine_Lib64%\XEngine_BaseLib\XEngine_Algorithm.dll" "./"
copy /y "%XEngine_Lib64%\XEngine_Core\XEngine_Core.dll" "./"
copy /y "%XEngine_Lib64%\XEngine_Core\XEngine_OPenSsl.dll" "./"
copy /y "%XEngine_Lib64%\XEngine_Core\XEngine_ManagePool.dll" "./"
copy /y "%XEngine_Lib64%\XEngine_Core\XEngine_NetXApi.dll" "./"

copy /y "%XEngine_Lib64%\x64\XEngine_NetHelp\NetHelp_APIHelp.dll" "./"
copy /y "%XEngine_Lib64%\x64\XEngine_Client\XClient_Socket.dll" "./"
copy /y "%XEngine_Lib64%\XEngine_NetHelp\NetHelp_APIHelp.dll" "./"
copy /y "%XEngine_Lib64%\XEngine_NetHelp\NetHelp_APIClient.dll" "./"
copy /y "%XEngine_Lib64%\XEngine_Client\XClient_Socket.dll" "./"

copy /y "%XEngine_Lib64%\x64\XEngine_HelpComponents\HelpComponents_XLog.dll" "./"
copy /y "%XEngine_Lib64%\x64\XEngine_HelpComponents\HelpComponents_Packets.dll" "./"
copy /y "%XEngine_Lib64%\x64\XEngine_RfcComponents\RfcComponents_ProxyProtocol.dll" "./"
copy /y "%XEngine_Lib64%\XEngine_HelpComponents\HelpComponents_XLog.dll" "./"
copy /y "%XEngine_Lib64%\XEngine_HelpComponents\HelpComponents_Packets.dll" "./"
copy /y "%XEngine_Lib64%\XEngine_RfcComponents\RfcComponents_ProxyProtocol.dll" "./"

copy /y "%XEngine_Lib64%\x64\XEngine_SystemSdk\XEngine_ProcFile.dll" "./"
copy /y "%XEngine_Lib64%\x64\XEngine_SystemSdk\XEngine_SystemApi.dll" "./"

copy /y "%XEngine_Lib64%\x64\XEngine_LibEx\libcrypto-3-x64.dll" "./"
copy /y "%XEngine_Lib64%\x64\XEngine_LibEx\libssl-3-x64.dll" "./"
copy /y "%XEngine_Lib64%\XEngine_SystemSdk\XEngine_SystemApi.dll" "./"
7 changes: 2 additions & 5 deletions XEngine_Source/VSCopy-x86.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@ copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_ManagePool.dll" "./"
copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_NetXApi.dll" "./"

copy /y "%XEngine_Lib32%\XEngine_NetHelp\NetHelp_APIHelp.dll" "./"
copy /y "%XEngine_Lib32%\XEngine_NetHelp\NetHelp_APIClient.dll" "./"
copy /y "%XEngine_Lib32%\XEngine_Client\XClient_Socket.dll" "./"

copy /y "%XEngine_Lib32%\XEngine_HelpComponents\HelpComponents_XLog.dll" "./"
copy /y "%XEngine_Lib32%\XEngine_HelpComponents\HelpComponents_Packets.dll" "./"
copy /y "%XEngine_Lib32%\XEngine_RfcComponents\RfcComponents_ProxyProtocol.dll" "./"

copy /y "%XEngine_Lib32%\XEngine_SystemSdk\XEngine_ProcFile.dll" "./"
copy /y "%XEngine_Lib32%\XEngine_SystemSdk\XEngine_SystemApi.dll" "./"

copy /y "%XEngine_Lib32%\XEngine_LibEx\libcrypto-3.dll" "./"
copy /y "%XEngine_Lib32%\XEngine_LibEx\libssl-3.dll" "./"
copy /y "%XEngine_Lib32%\XEngine_SystemSdk\XEngine_SystemApi.dll" "./"
10 changes: 0 additions & 10 deletions XEngine_Source/XEngine.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "XEngine_UserHdr", "XEngine_
XEngine_UserProtocol.h = XEngine_UserProtocol.h
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XEngine_ModuleAuthorize", "XEngine_ModuleAuthorize\XEngine_ModuleAuthorize.vcxproj", "{58026DC2-5383-490C-9BB4-BF3152192F0C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "XEngine_ThirdPart", "XEngine_ThirdPart", "{F18FFEA0-27D2-4590-9190-F69F5E3D21D2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jsoncpp", "XEngine_ThirdPart\jsoncpp\jsoncpp.vcxproj", "{F1736B3F-03A2-4FC7-B045-A12BA8D724FB}"
Expand Down Expand Up @@ -46,14 +44,6 @@ Global
{F54F152C-594F-4465-A44E-2DB915B39760}.Release|x64.Build.0 = Release|x64
{F54F152C-594F-4465-A44E-2DB915B39760}.Release|x86.ActiveCfg = Release|Win32
{F54F152C-594F-4465-A44E-2DB915B39760}.Release|x86.Build.0 = Release|Win32
{58026DC2-5383-490C-9BB4-BF3152192F0C}.Debug|x64.ActiveCfg = Debug|x64
{58026DC2-5383-490C-9BB4-BF3152192F0C}.Debug|x64.Build.0 = Debug|x64
{58026DC2-5383-490C-9BB4-BF3152192F0C}.Debug|x86.ActiveCfg = Debug|Win32
{58026DC2-5383-490C-9BB4-BF3152192F0C}.Debug|x86.Build.0 = Debug|Win32
{58026DC2-5383-490C-9BB4-BF3152192F0C}.Release|x64.ActiveCfg = Release|x64
{58026DC2-5383-490C-9BB4-BF3152192F0C}.Release|x64.Build.0 = Release|x64
{58026DC2-5383-490C-9BB4-BF3152192F0C}.Release|x86.ActiveCfg = Release|Win32
{58026DC2-5383-490C-9BB4-BF3152192F0C}.Release|x86.Build.0 = Release|Win32
{F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Debug|x64.ActiveCfg = Debug|x64
{F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Debug|x64.Build.0 = Debug|x64
{F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Debug|x86.ActiveCfg = Debug|Win32
Expand Down
4 changes: 2 additions & 2 deletions XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ typedef struct tag_XEngine_ServiceConfig
}st_XLog;
struct
{
int bAuth; //是否启用验证,大于0启用
XCHAR tszAuthFile[MAX_PATH]; //验证地址
bool bAuth; //是否启用验证
XCHAR tszAuthUrl[MAX_PATH]; //验证地址
}st_XAuth;
struct
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE
return false;
}
Json::Value st_JsonXAuth = st_JsonRoot["XAuth"];
pSt_ServerConfig->st_XAuth.bAuth = st_JsonXAuth["bAuth"].asInt();
_tcsxcpy(pSt_ServerConfig->st_XAuth.tszAuthFile, st_JsonXAuth["tszAuthFile"].asCString());
pSt_ServerConfig->st_XAuth.bAuth = st_JsonXAuth["bAuth"].asBool();
_tcsxcpy(pSt_ServerConfig->st_XAuth.tszAuthUrl, st_JsonXAuth["tszAuthUrl"].asCString());

if (st_JsonRoot["XVer"].empty())
{
Expand Down
29 changes: 29 additions & 0 deletions XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Define.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,35 @@ extern "C" XLONG ModuleProtocol_GetLastError(int* pInt_SysError = NULL);
备注:
*********************************************************************/
extern "C" bool ModuleProtocol_Packet_ForwardList(XCHAR* ptszMsgBuffer, int* pInt_Len, XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, SESSION_FORWARD * **pppSt_ListUser, int nCount);
/********************************************************************
函数名称:ModuleProtocol_Packet_Auth
函数功能:验证信息打包
参数.一:ptszMsgBuffer
In/Out:Out
类型:字符指针
可空:N
意思:输出封装好的包
参数.二:pInt_Len
In/Out:Out
类型:整数型指针
可空:N
意思:输出封装大小
参数.三:lpszUser
In/Out:In
类型:常量字符指针
可空:N
意思:输入用户名
参数.四:lpszPass
In/Out:In
类型:常量字符指针
可空:N
意思:输入密码
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
extern "C" bool ModuleProtocol_Packet_Auth(XCHAR* ptszMsgBuffer, int* pInt_Len, LPCXSTR lpszUser, LPCXSTR lpszPass);
/************************************************************************/
/* 解析导出函数 */
/************************************************************************/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ bool CModuleProtocol_Packet::ModuleProtocol_Packet_ForwardList(XCHAR* ptszMsgBuf
st_JsonObject["st_UserAuth"] = st_JsonSub;
st_JsonArray.append(st_JsonObject);
}
st_JsonRoot["code"] = 0;
st_JsonRoot["msg"] = "success";
st_JsonRoot["Count"] = nCount;
st_JsonRoot["Array"] = st_JsonArray;

Expand All @@ -94,4 +96,53 @@ bool CModuleProtocol_Packet::ModuleProtocol_Packet_ForwardList(XCHAR* ptszMsgBuf
memcpy(ptszMsgBuffer, pSt_ProtocolHdr, sizeof(XENGINE_PROTOCOLHDR));
memcpy(ptszMsgBuffer + sizeof(XENGINE_PROTOCOLHDR), st_JsonRoot.toStyledString().c_str(), pSt_ProtocolHdr->unPacketSize);
return true;
}
/********************************************************************
函数名称:ModuleProtocol_Packet_Auth
函数功能:验证信息打包
参数.一:ptszMsgBuffer
In/Out:Out
类型:字符指针
可空:N
意思:输出封装好的包
参数.二:pInt_Len
In/Out:Out
类型:整数型指针
可空:N
意思:输出封装大小
参数.三:lpszUser
In/Out:In
类型:常量字符指针
可空:N
意思:输入用户名
参数.四:lpszPass
In/Out:In
类型:常量字符指针
可空:N
意思:输入密码
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
bool CModuleProtocol_Packet::ModuleProtocol_Packet_Auth(XCHAR* ptszMsgBuffer, int* pInt_Len, LPCXSTR lpszUser, LPCXSTR lpszPass)
{
Protocol_IsErrorOccur = false;

if ((NULL == ptszMsgBuffer) || (NULL == pInt_Len))
{
Protocol_IsErrorOccur = true;
Protocol_dwErrorCode = ERROR_MODULE_PROTOCOL_PACKET_PARAMENT;
return false;
}
Json::Value st_JsonRoot;

st_JsonRoot["code"] = 0;
st_JsonRoot["msg"] = "success";
st_JsonRoot["lpszUser"] = lpszUser;
st_JsonRoot["lpszPass"] = lpszPass;

*pInt_Len = st_JsonRoot.toStyledString().length();
memcpy(ptszMsgBuffer, st_JsonRoot.toStyledString().c_str(), *pInt_Len);
return true;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ class CModuleProtocol_Packet
~CModuleProtocol_Packet();
public:
bool ModuleProtocol_Packet_ForwardList(XCHAR* ptszMsgBuffer, int* pInt_Len, XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, SESSION_FORWARD*** pppSt_ListUser, int nCount);
bool ModuleProtocol_Packet_Auth(XCHAR* ptszMsgBuffer, int* pInt_Len, LPCXSTR lpszUser, LPCXSTR lpszPass);
private:
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ EXPORTS
ModuleProtocol_GetLastError

ModuleProtocol_Packet_ForwardList
ModuleProtocol_Packet_Auth

ModuleProtocol_Parse_ForwardBind
4 changes: 4 additions & 0 deletions XEngine_Source/XEngine_ModuleProtocol/pch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ extern "C" bool ModuleProtocol_Packet_ForwardList(XCHAR * ptszMsgBuffer, int* pI
{
return m_ProtocolPacket.ModuleProtocol_Packet_ForwardList(ptszMsgBuffer, pInt_Len, pSt_ProtocolHdr, pppSt_ListUser, nCount);
}
extern "C" bool ModuleProtocol_Packet_Auth(XCHAR * ptszMsgBuffer, int* pInt_Len, LPCXSTR lpszUser, LPCXSTR lpszPass)
{
return m_ProtocolPacket.ModuleProtocol_Packet_Auth(ptszMsgBuffer, pInt_Len, lpszUser, lpszPass);
}
/************************************************************************/
/* 解析导出函数 */
/************************************************************************/
Expand Down
23 changes: 2 additions & 21 deletions XEngine_Source/XEngine_ModuleSession/ModuleSession_Define.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,25 +87,6 @@ extern "C" bool ModuleSession_Forward_List(SESSION_FORWARD * **pppSt_ListUser, i
*********************************************************************/
extern "C" bool ModuleSession_Forward_Bind(LPCXSTR lpszSrcAddr, LPCXSTR lpszDstAddr);
/********************************************************************
函数名称:ModuleSession_Forward_UNBind
函数功能:解除绑定转发需求
参数.一:lpszSrcAddr
In/Out:In
类型:常量字符指针
可空:N
意思:输入绑定的原始地址
参数.二:lpszDstAddr
In/Out:In
类型:常量字符指针
可空:N
意思:输出绑定的目标地址
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
extern "C" bool ModuleSession_Forward_UNBind(LPCXSTR lpszSrcAddr, LPCXSTR lpszDstAddr);
/********************************************************************
函数名称:ModuleSession_Forward_Delete
函数功能:删除用户
参数.一:lpszAddr
Expand Down Expand Up @@ -135,11 +116,11 @@ extern "C" bool ModuleSession_Forward_Delete(LPCXSTR lpszAddr, XCHAR * ptszDstAd
参数.二:ptszDstAddr
In/Out:Out
类型:字符指针
可空:N
可空:Y
意思:输出对端地址
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
extern "C" bool ModuleSession_Forward_Get(LPCXSTR lpszAddr, XCHAR* ptszDstAddr);
extern "C" bool ModuleSession_Forward_Get(LPCXSTR lpszAddr, XCHAR* ptszDstAddr = NULL);
Loading

0 comments on commit 8ce38f2

Please sign in to comment.