@imenam/mcp-http-gateway 2.0.4 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server.js +5 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imenam/mcp-http-gateway",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "type": "module",
5
5
  "description": "HTTP gateway that exposes MCP servers as REST routes — bridge between MCP and any HTTP-capable agent",
6
6
  "main": "server.js",
package/server.js CHANGED
@@ -108,6 +108,11 @@ async function main() {
108
108
  const servers = config.mcpServers ?? {};
109
109
 
110
110
  const app = express();
111
+ if (process.env.TRUST_PROXY) {
112
+ const val = process.env.TRUST_PROXY;
113
+ app.set('trust proxy', val === 'true' || val === '1' ? 1 : val);
114
+ console.log(`[gateway] Trust proxy enabled (TRUST_PROXY=${val})`);
115
+ }
111
116
  app.use(express.json({ type: '*/*' }));
112
117
 
113
118
  const globalWindowMin = parseInt(process.env.RATE_LIMIT_GLOBAL_WINDOW_MINUTES ?? '15', 10);