const http = require('http');
const https = require('https');

const TARGET = 'agentrouter.org';
const PORT = 5000;

const server = http.createServer((req, res) => {
  console.log(`${req.method} ${req.url}`);

  const options = {
    hostname: TARGET,
    port: 443,
    path: req.url,
    method: req.method,
    headers: {
      ...req.headers,
      'host': TARGET,
      'User-Agent': 'RooCode/3.28.15',
      'HTTP-Referer': 'https://github.com/RooVetGit/Roo-Cline',
      'X-Title': 'Roo Code'
    }
  };

  const proxy = https.request(options, (proxyRes) => {
    res.writeHead(proxyRes.statusCode, proxyRes.headers);
    proxyRes.pipe(res);
  });

  proxy.on('error', (err) => {
    console.error('Proxy error:', err);
    res.writeHead(500);
    res.end('Proxy error');
  });

  req.pipe(proxy);
});

server.listen(PORT, () => {
  console.log(`Proxy running at http://localhost:${PORT}`);
  console.log(`Forwarding to https://${TARGET}`);
});
Edit

Pub: 10 Oct 2025 04:54 UTC

Views: 132