nodejs的http-proxy反向代理如何开启流式请求支持eventsource?
网友回复
增加ws:true
const proxy = httpProxy.createProxyServer({ ws: true});
const http = require('http'); const httpProxy = require('http-proxy'); // 创建一个代理服务器实例 const proxy = httpProxy.createProxyServer({ ws: true }); // 修改请求头中的 Host 字段 proxy.on('proxyReq', (proxyReq, req, res, options) => { proxyReq...
点击查看剩余70%