假设我们在http://www.example.com/video.mp4上有一个视频
是否可以使用另一个无法追踪的链接名称来嵌入此视频?
<video src ='http://www.proxyserver.com/video.mp4'/>
喜欢Proxied链接?
要清楚:我不想下载视频。
有可能,您应该使用http
librairie创建一个带有节点的http服务器,当您在该服务器上获得请求时,您只需要使用带有流支持的请求模块在http://www.example.com/video.mp4
上发出真实请求,那么您可以只使用res.pipe(videoStream)
和它应该工作。
例子(没有经过测试但是这样的东西当然可以使用express / koa / etc而不是http)
const http = require('http')
http.createServer(function (req, res) {
if (req.path === '/video.mp4') {
const stream = request.get('http://www.example.com/video.mp4')
res.end(stream)
}
}).listen(3000)