Skip to content

Commit c64d7f3

Browse files
authored
Merge pull request #9 from libxengine/develop
V1.6.0.1001 Merge
2 parents 59352d3 + b06f04b commit c64d7f3

File tree

21 files changed

+228
-59
lines changed

21 files changed

+228
-59
lines changed

CHANGELOG

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
XEngine_ProxyServer V1.6.0.1001
2+
3+
增加:数据转发解绑协议支持
4+
增加:数据转发为会话模块插入现在有用户信息了
5+
更新:匹配XEngine到V8.15版本
6+
修改:数据转发枚举用户信息现在有更多信息
7+
修正:数据转发枚举用户列表没有释放内存的问题
8+
修正:数据转发用户登录的时候没有创建包管理器的问题
9+
修正:数据转发用户退出没有释放包资源的问题
10+
删除:数据转发没有用的协议处理代码
11+
12+
added:unbind protocol supported
13+
added:insert have user info for session module
14+
update:match xengine v8.15
15+
modify:Enumerating users now has more information
16+
fixed:does not free memory when enum user
17+
fixed:forward does not create packet when client login
18+
fixed:does not delete packet res when client close
19+
modify:does not close bind client when client close
20+
delete:unused protocol code
21+
======================================================================================
122
XEngine_ProxyServer V1.5.1.1001
223

324
更新:匹配XEngine到V8.x版本

README.en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ this software support following features
2525
## install
2626

2727
#### XEngine Evn
28-
you must install XEngine,need V8.10 or above,install XEngine can be refer to xengine Readme docment
28+
you must install XEngine,need V8.15 or above,install XEngine can be refer to xengine Readme docment
2929
GITEE:https://gitee.com/xyry/libxengine
3030
GITHUB:https://github.com/libxengine/xengine
3131

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ c c++ Socks5 Proxy Service,HTTP Tunnel Proxy Service,tcp forward service
2525
## 安装教程
2626

2727
#### XEngine环境
28-
必须安装XEngine,版本需要V8.10或者以上版本,安装XEngine可以参考其Readme文档
28+
必须安装XEngine,版本需要V8.15或者以上版本,安装XEngine可以参考其Readme文档
2929
GITEE:https://gitee.com/xyry/libxengine
3030
GITHUB:https://github.com/libxengine/xengine
3131

@@ -89,6 +89,9 @@ make FLAGS=CleanAll 清理编译
8989
透传代理
9090
转发代理支持权限和确认
9191
支持加密代理
92+
转发代理绑定解绑支持附加用户信息
93+
转发代理绑定支持拒绝
94+
转发代理支持用户验证
9295

9396
## 关注我们
9497
如果你觉得这个软件对你有帮助,请你给我们一个START吧

XEngine_APPClient/APPClient_ForwardExample/APPClient_ForwardExample.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,31 @@ int main(int argc, char** argv)
4545

4646
int nMsgLen = 0;
4747
XENGINE_PROTOCOLHDR st_ProtocolHdr;
48+
XENGINE_PROTOCOL_USERAUTH st_UserAuth;
49+
4850
memset(&st_ProtocolHdr, '\0', sizeof(XENGINE_PROTOCOLHDR));
51+
memset(&st_UserAuth, '\0', sizeof(XENGINE_PROTOCOL_USERAUTH));
4952
//登录
5053
st_ProtocolHdr.wHeader = XENGIEN_COMMUNICATION_PACKET_PROTOCOL_HEADER;
5154
st_ProtocolHdr.wTail = XENGIEN_COMMUNICATION_PACKET_PROTOCOL_TAIL;
5255
st_ProtocolHdr.byIsReply = true;
5356
st_ProtocolHdr.byVersion = 0;
57+
st_ProtocolHdr.unPacketSize = sizeof(XENGINE_PROTOCOL_USERAUTH);
5458
st_ProtocolHdr.unOperatorType = ENUM_XENGINE_COMMUNICATION_PROTOCOL_TYPE_AUTH;
5559
st_ProtocolHdr.unOperatorCode = XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_FORWARD_LOGREQ;
5660

61+
_tcsxcpy(st_UserAuth.tszUserName, "test");
62+
5763
if (!XClient_TCPSelect_SendMsg(m_Socket, (LPCXSTR)&st_ProtocolHdr, sizeof(XENGINE_PROTOCOLHDR)))
5864
{
5965
printf("发送失败!\n");
6066
return 0;
6167
}
68+
if (!XClient_TCPSelect_SendMsg(m_Socket, (LPCXSTR)&st_UserAuth, sizeof(XENGINE_PROTOCOL_USERAUTH)))
69+
{
70+
printf("发送失败!\n");
71+
return 0;
72+
}
6273

6374
nMsgLen = 0;
6475
XCHAR* ptszMsgBuffer = NULL;
@@ -104,7 +115,7 @@ int main(int argc, char** argv)
104115
//请求绑定
105116
Json::Value st_JsonRoot;
106117
Json::Value st_JsonArray = st_JsonAddr["Array"];
107-
st_JsonRoot["tszDstAddr"] = st_JsonArray[0].asCString();
118+
st_JsonRoot["tszDstAddr"] = st_JsonArray[0]["tszSrcAddr"].asCString();
108119

109120
st_ProtocolHdr.wHeader = XENGIEN_COMMUNICATION_PACKET_PROTOCOL_HEADER;
110121
st_ProtocolHdr.wTail = XENGIEN_COMMUNICATION_PACKET_PROTOCOL_TAIL;
@@ -172,7 +183,7 @@ int main(int argc, char** argv)
172183
}
173184
}
174185

175-
std::this_thread::sleep_for(std::chrono::seconds(5000));
186+
std::this_thread::sleep_for(std::chrono::seconds(20000));
176187
XClient_TCPSelect_Close(m_Socket);
177188
#ifdef _MSC_BUILD
178189
WSACleanup();

XEngine_APPClient/APPClient_ForwardExample/APPClient_ForwardExample.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
<ClCompile>
7979
<WarningLevel>Level3</WarningLevel>
8080
<SDLCheck>true</SDLCheck>
81-
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
81+
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
8282
<ConformanceMode>true</ConformanceMode>
8383
</ClCompile>
8484
<Link>

XEngine_Docment/Docment_en.docx

1.68 KB
Binary file not shown.

XEngine_Docment/Docment_zh.docx

1.49 KB
Binary file not shown.

XEngine_Release/XEngine_Config/XEngine_Config.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,20 @@
1414
"nTimeCheck": 3,
1515
"nSocksTimeOut": 5,
1616
"nTunnelTimeOut": 5,
17-
"nForwardTimeOut": 5
17+
"nForwardTimeOut": 0
1818
},
1919
"XLog": {
2020
"MaxSize": 1024000,
2121
"MaxCount": 10,
2222
"LogLeave": 32,
23-
"tszLogFile": "./XEngine_Log/XEngine_ServiceApp.log"
23+
"tszLogFile": "./XEngine_Log/XEngine_ProxyServiceApp.log"
2424
},
2525
"XAuth": {
2626
"bAuth": 0,
2727
"tszAuthFile": "./XEngine_Config/UserList.txt"
2828
},
2929
"XVer": [
30+
"1.6.0.1001 Build20230817",
3031
"1.5.1.1001 Build20230426",
3132
"1.5.0.1001 Build20230202",
3233
"1.4.0.1001 Build20221111",

XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Define.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ extern "C" XLONG ModuleProtocol_GetLastError(int* pInt_SysError = NULL);
3535
类型:协议头
3636
可空:N
3737
意思:输入请求的头
38-
参数.四:ppptszListAddr
38+
参数.四:pppSt_ListUser
3939
In/Out:In
4040
类型:三级指针
4141
可空:N
@@ -50,7 +50,7 @@ extern "C" XLONG ModuleProtocol_GetLastError(int* pInt_SysError = NULL);
5050
意思:是否成功
5151
备注:
5252
*********************************************************************/
53-
extern "C" bool ModuleProtocol_Packet_ForwardList(XCHAR* ptszMsgBuffer, int* pInt_Len, XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, XCHAR*** ppptszListAddr, int nCount);
53+
extern "C" bool ModuleProtocol_Packet_ForwardList(XCHAR* ptszMsgBuffer, int* pInt_Len, XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, SESSION_FORWARD * **pppSt_ListUser, int nCount);
5454
/************************************************************************/
5555
/* 解析导出函数 */
5656
/************************************************************************/

XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Packet/ModuleProtocol_Packet.cpp

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ CModuleProtocol_Packet::~CModuleProtocol_Packet()
4040
类型:协议头
4141
可空:N
4242
意思:输入请求的头
43-
参数.四:ppptszListAddr
43+
参数.四:pppSt_ListUser
4444
In/Out:In
4545
类型:三级指针
4646
可空:N
@@ -55,7 +55,7 @@ CModuleProtocol_Packet::~CModuleProtocol_Packet()
5555
意思:是否成功
5656
备注:
5757
*********************************************************************/
58-
bool CModuleProtocol_Packet::ModuleProtocol_Packet_ForwardList(XCHAR* ptszMsgBuffer, int* pInt_Len, XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, XCHAR*** ppptszListAddr, int nCount)
58+
bool CModuleProtocol_Packet::ModuleProtocol_Packet_ForwardList(XCHAR* ptszMsgBuffer, int* pInt_Len, XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, SESSION_FORWARD*** pppSt_ListUser, int nCount)
5959
{
6060
Protocol_IsErrorOccur = false;
6161

@@ -70,7 +70,20 @@ bool CModuleProtocol_Packet::ModuleProtocol_Packet_ForwardList(XCHAR* ptszMsgBuf
7070

7171
for (int i = 0; i < nCount; i++)
7272
{
73-
st_JsonArray[i] = (*ppptszListAddr)[i];
73+
Json::Value st_JsonObject;
74+
Json::Value st_JsonSub;
75+
st_JsonObject["bForward"] = (*pppSt_ListUser)[i]->bForward;
76+
st_JsonObject["tszSrcAddr"] = (*pppSt_ListUser)[i]->tszSrcAddr;
77+
st_JsonObject["tszDstAddr"] = (*pppSt_ListUser)[i]->tszDstAddr;
78+
79+
st_JsonSub["tszUserName"] = (*pppSt_ListUser)[i]->st_UserAuth.tszUserName;
80+
st_JsonSub["tszUserPass"] = (*pppSt_ListUser)[i]->st_UserAuth.tszUserPass;
81+
st_JsonSub["tszDCode"] = (*pppSt_ListUser)[i]->st_UserAuth.tszDCode;
82+
st_JsonSub["enClientType"] = (*pppSt_ListUser)[i]->st_UserAuth.enClientType;
83+
st_JsonSub["enDeviceType"] = (*pppSt_ListUser)[i]->st_UserAuth.enDeviceType;
84+
85+
st_JsonObject["st_UserAuth"] = st_JsonSub;
86+
st_JsonArray.append(st_JsonObject);
7487
}
7588
st_JsonRoot["Count"] = nCount;
7689
st_JsonRoot["Array"] = st_JsonArray;

0 commit comments

Comments
 (0)