Skip to content

This is a Relay Server for World of Warcraft, designed to function as a Content Delivery Network (CDN) for the game. It conceals the actual server IP to safeguard it from DDoS attacks. Additionally, it enhances the ping for players, providing a smoother gaming experience.

Notifications You must be signed in to change notification settings

masterking32/WoW-Server-Relay

Repository files navigation

World of Warcraft (WoW) Relay Server

English | Spanish

This project enables the creation of additional servers that function as a Content Delivery Network (CDN) for World of Warcraft private servers. It allows you to conceal your main server IP from users. Players connect to the relay servers, which then handle and forward packets to the main server. This setup not only protects your main server from DDoS attacks but also provides a smoother gameplay experience by having CDNs at different locations.

⭐ If you find this project useful, feel free to give it a star! ⭐

This project reads and handles packets from the client for AuthServer and functions like a WoW Auth Server and WoW Client. Additionally, it edits the REALMLIST_PACKET to replace the main server IP with the relay IP. Contributions are welcome.

How It Works?

How it Works?

Why Should We Use This Tool and What Makes It Different?

1) Does adding another node in the network increase ping?

Contrary to what some may believe, adding another node can actually decrease ping for users. For instance, if your server is located in the EU, but you have players in North and South America, each player will have a different network route to the EU. If you establish a server in the US with a better route to your EU server, players can connect to your US server. This server will then forward packets via the better route, resulting in improved ping for players.

2) How does it mitigate DDoS attacks?

Most DDoS attacks utilize packet types such as UDP, ACK, SYN, etc. This tool does not forward all types of these attacks to your main server. By implementing rate limits on your UFW/IPtable, you can further protect your main server from DDoS attacks. If one of your servers is under attack, some users connected to that server may get disconnected, but others can still play. While this tool can help mitigate the effects of DDoS attacks, it does not provide 100% protection. It simply adds an additional layer of network security.

3) Why should we use this instead of Load Balancers, IPTable forwards, and other proxy tools?

Issue 1:

While you can use other tools to forward packets, load balancers, etc., it's important to understand that by default, TrinityCore/AzerothCore retrieves the user's IP from the remote socket IP. This means that when you use something like IPTable, the user's IP on the WoW server is your relay server's IP. For instance, if us-relay1's IP is 8.8.8.8, and a player connected to that server attempts the wrong password multiple times, the server will ban 8.8.8.8 instead of the user's IP. Consequently, no one can connect to the server from the us-relay1 node. For users connected to the WoW server from the us-relay1 node, the IP will always be 8.8.8.8, and in the game, if you cannot retrieve the real player's IP, you will always see the relay node IPs.

How did you fix it?

This project works like other forwarders by default, but with a difference: it only works for WoW and reads, parses, and handles packets. To fix the read-ip issue, we added a custom packet for WorldServer and AuthServer with these Opcodes:

RELAY_SERVER_CMD_AUTH = 0x64 // 100
RELAY_SERVER_CMD_WORLD = 0xA32 // 2610

If you enable send_relay_packet in the config file, this project will send a relay packet to the auth and world server after opening a socket connection. This packet includes a secret key and the real IP of the user. Your Auth and World servers need to parse this packet and replace the user IP with the IP inside this packet.

Packet Structure for AuthServer

Offset Size Type Name Description
0x0 1 uint8 OpCode Opcode for relay custom packet. RELAY_SERVER_CMD_AUTH = 0x64
0x1 2 uint16 Secret_Len Secret key length
0x3 2 uint16 IP_len The length of user IP
0x5 - String Secret_Key The secret key value starts from 0x5 and ends with Secret_Len
- - String User_IP User IP address

Packet Structure for WorldServer

HEADER

Offset Size Type Name Description
0x0 2 uint16 Size Packet Header - Size of Packet (Size of the packet including the opcode field.)
0x2 4 uint32 CMD Packet Header - Opcode or Command for relay custom packet. RELAY_SERVER_CMD_WORLD = 0xA32

BODY

Offset Size Type Name Description
0x0 - String Secret_Key The secret key value starts from 0x6 and ends with Secret_Len. (Null terminated string)
- - String User_IP User IP address. (Null terminated string)

Does TrinityCore/AzerothCore support this packet?

  • TrinityCore Custom Changes:

For TrinityCore, you can refer to masterking32/TrinityCore-Relay-Support and this specific commit for version 3.3.5. These resources will guide you on how to make custom changes to your core to support handling and parsing of the relay packet.

  • AzerothCore Custom Changes/Module:

Check these changes for AzerothCore


Please Note: If you haven't made any custom changes to the core, ensure that send_relay_packet is set to false. If you have made custom changes, set send_relay_packet to true and establish a secure secret_key that is between 32 to 64 characters long (the maximum allowed value is 64). This secret_key should be the same in both this project's config.js file and your core configuration files, authserver.conf and worldserver.conf.


Installation Guide for Ubuntu/Debian

  1. Install the required packages:

    apt install curl git nano sudo
  2. Install NodeJS (version 20 or higher):

    curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash -
    sudo apt-get install -y nodejs
  3. Download the project:

    git clone https://github.com/masterking32/WoW-Server-Relay
    cd WoW-Server-Relay
  4. Install NPM Packages:

    npm install
  5. Configure the project:

    cp config.js.sample config.js
    nano config.js
  6. Run the project:

    node app.js
  7. Run as Service/Startup:

    npm install pm2 -g
    pm2 start app.js
    pm2 startup
    pm2 save

Note: For optimal performance, support for real user IP, and to ensure the IP ban function works on your server, you need to make some modifications to your core. Please read this section and apply the necessary changes to your core.


Windows Installation:

  1. Download and install the latest version of NodeJS.
  2. Download the project and extract the files.
  3. Navigate to the project directory and rename config.js.sample to config.js.
  4. Modify the config.js file with your server information.
  5. Open the Command Prompt, navigate to the project directory.
  6. Run the command node app.js.
  7. Ensure that the necessary ports are open in your firewall.

Note: For optimal performance, support for real user IP, and to ensure the IP ban function works on your server, you need to make some modifications to your core. Please read this section and apply the necessary changes to your core.


Developer Information

This project was developed by Amin.MasterkinG. You can also find me on Github.

About

This is a Relay Server for World of Warcraft, designed to function as a Content Delivery Network (CDN) for the game. It conceals the actual server IP to safeguard it from DDoS attacks. Additionally, it enhances the ping for players, providing a smoother gaming experience.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published