Replace global host/port variables with a `HookConfig` struct and mutex-protected getters/setters to make configuration access thread-safe and consistently validated. In request/websocket hooks, centralize host patching with `maybeRedirect()` and a `QSet` whitelist, skipping redirects when config is invalid. Also consolidate symbol-hook setup into a shared helper with clearer error logging and library constants.