mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 05:06:24 +00:00
feat(Core/Network): Add Proxy Protocol v2 support. (#18839)
* feat(Core/Network): Add Proxy Protocol v2 support. * Fix codestyle and build. * Another codestyle fix. * One more missing include.
This commit is contained in:
committed by
GitHub
parent
715b290cb7
commit
9815025341
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user