proxy.on('proxyRes', function (proxyRes, request, response){ proxyRes.on('end',function(){ if(proxyRes.headers['content-type']=='text/html;charset=utf-8'){ proxyRes.write('hhhhhhhhhhh'); //这个是错误的 } }) })
代码如上,用了http-proxy的代码,监听了响应事件,怎么才能修改响应的内容呢?
回复 (1)
L
关注
参与回复
登录后即可参与回复。登录