Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2024-05-07 22:22:40 +08:00
8 changed files with 248 additions and 13 deletions

View File

@@ -20,6 +20,7 @@
#include "AuthSession.h"
#include "SocketMgr.h"
#include "Config.h"
class AuthSocketMgr : public SocketMgr<AuthSession>
{
@@ -44,7 +45,13 @@ public:
protected:
NetworkThread<AuthSession>* CreateThreads() const override
{
return new NetworkThread<AuthSession>[1];
NetworkThread<AuthSession>* threads = new NetworkThread<AuthSession>[1];
bool proxyProtocolEnabled = sConfigMgr->GetOption<bool>("EnableProxyProtocol", false, true);
if (proxyProtocolEnabled)
threads[0].EnableProxyProtocol();
return threads;
}
static void OnSocketAccept(tcp::socket&& sock, uint32 threadIndex)

View File

@@ -64,6 +64,16 @@ RealmServerPort = 3724
BindIP = "0.0.0.0"
#
# EnableProxyProtocol
# Description: Enables Proxy Protocol v2. When your server is behind a proxy,
# load balancer, or similar component, you need to enable Proxy Protocol v2 on both
# this server and the proxy/load balancer to track the real IP address of players.
# Example: 1 - (Enabled)
# Default: 0 - (Disabled)
EnableProxyProtocol = 0
#
# PidFile
# Description: Auth server PID file.

View File

@@ -378,6 +378,16 @@ Network.OutUBuff = 4096
Network.TcpNodelay = 1
#
# Network.EnableProxyProtocol
# Description: Enables Proxy Protocol v2. When your server is behind a proxy,
# load balancer, or similar component, you need to enable Proxy Protocol v2 on both
# this server and the proxy/load balancer to track the real IP address of players.
# Example: 1 - (Enabled)
# Default: 0 - (Disabled)
Network.EnableProxyProtocol = 0
#
###################################################################################################