1

I have a server which acts as a middle man between an HTTP client that I don't control and a remote file hosting server I don't control. I want to expose a URL through which the client can download a chunk (specified by HTTP range headers my server provides) of a file on the remote server.

There are two important constraints here: I'd like to facilitate this partial download without having the response flow back through my server (response goes straight to client) and without writing a custom client. How can I accomplish this?

One option I tried was having my endpoint send a redirect response with the range headers set on the response, but unfortunately those do not get forwarded onto the subsequent request from the client and as a result the entire file is downloaded. Are there any other hacky tricks / network wizardry I can employ to achieve this end given the constraints?

  • Briefly, I don't think this is possible. If you don't want a custom client you need to rely on the semantics of HTTP. That means redirects, and there's simply no way for the redirect to indicate that a range header should be used. – Kevin Christopher Henry Feb 20 '21 at 18:53
  • Thanks for the response @KevinChristopherHenry. I think you're right, I'm going to need to think of another way to do this. – vroomwaddle Feb 21 '21 at 01:32

1 Answers1

0

i am also thinking about this since 5 days it's like the server give you file only when you give required header from your side and without header it will deny your request and middleman if it does get request with required header then file will be accessable through your middleman to client and you are trying to client get file from server not from your custom server which is trying to pass headers to server for your client