Search code examples
node.jsproxyxmlhttprequestreverse-proxy

Proxy a binary file with node.js without redirecting the traffic?


Is it possible to proxy a binary file (audio/mpeg in my case) with node.js and just modify some headers, but not redirect the files' traffic through your proxy-server?

As I basically just want to add CORS headers to the remote audiofile, to be able to open it via XHttpRequest, this proxy seems to be good solution: https://github.com/gr2m/CORS-Proxy

But would it be possible to just add the headers and "redirecting" to the binary file on a remote Server at the same time, so that the actual file is not being transferred over the proxy?


Solution

  • Is it possible to proxy a binary file (audio/mpeg in my case) with node.js and just modify some headers, but not redirect the files' traffic through your proxy-server?

    No. It's the most heretic thing I'd heard of. I would call it a nonsense. You can NOT do this kind of thing with node.js or any other server-side technology.