mirror of
https://github.com/samanhappy/mcphub.git
synced 2026-01-10 08:38:23 -05:00
fix: add localnet configuration for Proxychains4 (#547)
This commit is contained in:
@@ -84,9 +84,7 @@ const generateProxychainsConfig = (
|
||||
if (fs.existsSync(proxyConfig.configPath)) {
|
||||
return proxyConfig.configPath;
|
||||
}
|
||||
console.warn(
|
||||
`[${serverName}] Custom proxychains config not found: ${proxyConfig.configPath}`,
|
||||
);
|
||||
console.warn(`[${serverName}] Custom proxychains config not found: ${proxyConfig.configPath}`);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -97,13 +95,19 @@ const generateProxychainsConfig = (
|
||||
}
|
||||
|
||||
const proxyType = proxyConfig.type || 'socks5';
|
||||
const proxyLine = proxyConfig.username && proxyConfig.password
|
||||
const proxyLine =
|
||||
proxyConfig.username && proxyConfig.password
|
||||
? `${proxyType} ${proxyConfig.host} ${proxyConfig.port} ${proxyConfig.username} ${proxyConfig.password}`
|
||||
: `${proxyType} ${proxyConfig.host} ${proxyConfig.port}`;
|
||||
|
||||
const configContent = `# Proxychains4 configuration for MCP server: ${serverName}
|
||||
# Generated by MCPHub
|
||||
|
||||
localnet 127.0.0.0/255.0.0.0
|
||||
localnet 10.0.0.0/255.0.0.0
|
||||
localnet 172.16.0.0/255.240.0.0
|
||||
localnet 192.168.0.0/255.255.0.0
|
||||
|
||||
strict_chain
|
||||
proxy_dns
|
||||
remote_dns_subnet 224
|
||||
@@ -824,7 +828,8 @@ export const getServersInfo = async (
|
||||
// Apply user filtering only when NOT using pagination (pagination already filtered at DAO level)
|
||||
// Or when no pagination parameters provided (backward compatibility)
|
||||
const shouldApplyUserFilter = !isPaginated;
|
||||
const filterServerInfos: ServerInfo[] = shouldApplyUserFilter && dataService.filterData
|
||||
const filterServerInfos: ServerInfo[] =
|
||||
shouldApplyUserFilter && dataService.filterData
|
||||
? dataService.filterData(filteredServerInfos, user)
|
||||
: filteredServerInfos;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user