How freennzzy/gtproxy works
Growtopia Proxy intercepts traffic between the game client and Growtopia servers so users can inspect and modify packets. The main path is client connection, packet decoding and event dispatch, proxy handlers (including sub-server redirection), then forwarding to the game server; packet events also feed commands and world/item state. The README additionally documents configuration, client metadata over HTTP, and packet debugging/modification. Some subsystems are represented from the file tree and README because their implementation was not sampled; uncertain internal wiring is omitted.
Main entry points: core.cpp Core runtime · server.cpp Client-facing proxy · connection_handler.cpp Connection handling · client.cpp Upstream connection
Components 21
Runtime and configuration
- Application entry
src/main.cpp - Core runtime
src/core/core.cpp - Configuration
src/core/config.cpp - Metadata HTTP server
src/core/web_server.cpp - Task scheduler
src/core/scheduler.cpp
Proxy networking
- Client-facing proxy
src/network/server.cpp - Upstream connection
src/network/client.cpp - Packet forwarding
src/core/handlers/forwarding_handler.cpp - Connection handling
src/core/handlers/connection_handler.cpp
Packets and events
- Packet decoder
src/packet/packet_decoder.cpp - Event dispatcher
src/event/event.hpp - Packet definitions
src/packet/packet_types.hpp
Game state
- World event handling
src/core/handlers/world_handler.cpp - World and player state
src/world/world.hpp - Item database
src/item/item_database.cpp
Commands and scripting
- Chat commands
src/command/command_handler.cpp - Lua scripting
src/scripting/lua_engine.cpp - Script loading
src/scripting/script_loader.cpp
Other components
- Proxy user
- Growtopia client
- Growtopia server
Connections 30
- Proxy user → Application entry: starts proxy
- Application entry → Core runtime: runs
- Core runtime → Configuration: loads settings
- Core runtime → Client-facing proxy: creates listener
- Core runtime → Upstream connection: creates connection
- Core runtime → Connection handling: registers handlers
- Core runtime → Packet forwarding: registers handler
- Core runtime → World event handling: registers handler
- Core runtime → Chat commands: creates handler
- Core runtime → Metadata HTTP server: starts server
- Growtopia client → Client-facing proxy: sends packets
- Client-facing proxy → Packet decoder: decodes data
- Client-facing proxy → Event dispatcher: dispatches events
- Client-facing proxy → Connection handling: dispatches connection events
- Connection handling → Upstream connection: connects upstream
- Connection handling → Client-facing proxy: rewrites login packet
- Upstream connection → Growtopia server: connects upstream
- Packet forwarding → Upstream connection: forwards packets
- Packet forwarding → Client-facing proxy: forwards packets
- Event dispatcher → World event handling: dispatches packet events
- Event dispatcher → Chat commands: dispatches input events
- World event handling → World and player state: updates state
- Connection handling → Item database: parses item data
- Event dispatcher → Packet definitions: uses packet events
- Proxy user → Lua scripting: provides scripts
- Core runtime → Script loading: loads scripts
- Script loading → Lua scripting: executes files
- Lua scripting → Task scheduler: schedules tasks
- Chat commands → Upstream connection: uses connection
- Chat commands → Client-facing proxy: uses connection