How to properly configure types proxy for optimal performance? or What are the best practices to conf

14 Replies, 1041 Views

If you’re working with TypeScript, ts-node + http-proxy is a solid combo. The docs are meh, but this setup works:

```typescript
import * as httpProxy from 'http-proxy';
const proxy = httpProxy.createProxyServer();
server.use('/path', (req, res) => proxy.web(req, res, { target: 'http://target' }));
```

Pro tip: Always log errors. Proxy fails silently way too often.

Messages In This Thread



Users browsing this thread: 1 Guest(s)