Hi
@Qwatt, thank you for the kind words!
First, just to clarify a quick technical detail: XenForo templates only render the front-end HTML/CSS layout in the browser. Outgoing AI requests (to OpenAI, Claude, Gemini, etc.) are executed on the server side via PHP using XenForo's underlying Guzzle HTTP client. Therefore, proxy routing cannot be configured inside XenForo template modifications.
Currently, there isn't a dedicated per-bot/per-provider SOCKS5 proxy field in the Admin Control Panel. However, you can easily achieve this using one of the following two methods:
Method 1: Global XenForo Proxy (No add-on modification needed)
If you want all outgoing XenForo HTTP traffic to route through your SOCKS5 proxy, you can simply add this line to your src/config.php:
Code:
$config['http']['proxy'] = 'socks5h://username:password@proxy-ip:port';
Method 2: AI Provider-Specific Proxy (Quick PHP Modification)
If you only want the AI Assistant requests routed through the SOCKS5 proxy, you can modify the base provider service:
File: src/addons/XENTR/AIAssistant/Service/AI/AbstractProvider.php
Method: sendRequest()
Around line 74, locate $client->post(...) and add the 'proxy' option to the request array:
PHP:
$response = $client->post($url, [
'json' => $data,
'headers' => $mergedHeaders,
'timeout' => $timeout,
'connect_timeout' => min(30, $timeout),
'http_errors' => false,
'proxy' => 'socks5h://username:password@proxy-ip:port', // <-- Your SOCKS5 proxy URL
]);
If you want to restrict the proxy to a
specific provider (e.g., only OpenAI):
PHP:
$requestOptions = [
'json' => $data,
'headers' => $mergedHeaders,
'timeout' => $timeout,
'connect_timeout' => min(30, $timeout),
'http_errors' => false,
];
if ($this->provider && $this->provider->provider_id === 'openai') {
$requestOptions['proxy'] = 'socks5h://username:password@proxy-ip:port';
}
$response = $client->post($url, $requestOptions);
Roadmap Note:
This is a great feature suggestion! We have added an optional
"HTTP / SOCKS5 Proxy" configuration field directly into the AI Provider settings in ACP to our roadmap for upcoming updates so that you won't need manual code edits in the future.
Let me know if you have any questions or need further guidance!