我想将HTTP响应从请求传递到另一台服务器(我们称之为服务器B)。然后,除非必须设置标头,否则服务器B会将响应传递给客户端,而无需对其进行操作。该响应为x-mixed-replace MIME类型,因为它从网络摄像头传输MJPEG视频。有关轻松进行此操作的任何提示?流,套接字,HTTP,TCP等? 服务器A代码:
var request_options = {
auth: {
username: 'T',
password: 't'},
url: 'http://10.0.0.35:1080/mjpeg',
};
var req_pipe = request(request_options);
/*
Pass to server B when any part of webcam stream is received...
*/
req_pipe.on('error', function(e){
console.log('[model-airport-webcam-proxy-local] Cannot connect...');
res.send("Cannot connect to local webcam...");
});