My case as follows: I have a route on server X that returns files to be downloaded by the client's browser (with all headers + filename set).
I want this request to go through a php server, so server X is never exposed to the end user.
Basically what i want to do is to pipe the original request (which was already tested and working as intended) through my php server, retaining all of the original headers.
For some reason I'm having a hard time achieving this, so suggestions could be great.
Thanks in advance!
For clarification:
Lets say we go to the browser and type this url: http://serverX/downloadFile
The result is: Docx file with the name "myfile.docx" downloads.
Now what i want is to pipe this request through my php server, so when i type the url:
The result will be: Docx file with the name "myfile.docx" downloads.
Code wise, i would expect it to look something like that:
Echo Pipe_request($url);
Thanks!