0

Let's say I have a video located at address: A.

And I have a PHP web server running at address: B.

Now, when I (as a user) go to B, I want B to send video (located A) contents to me, but I don't want it to happen directly (as a user, I don't want to see/go to A's location directly), instead I want it to happen through B. In other words I want my request of video first go to B and then I want B to go to A and send relevant chunk of video to me, effectively acting as a proxy.

How is that possible in PHP?

Detailed context:

Some video websites have enforced country wide rate limiting, so when you live in a different country, you can hardly stream the video (Super slow) from them. What I'm trying to achieve is, I'm buying a cheap server (B) in the same country as video website (with very small disk size, so downloading the whole video on server is not possible) and then I'm trying to watch those videos through my server B where B is basically serving as a bridge between my video request and video itself.

Giorgi Cercvadze
  • 403
  • 1
  • 7
  • 23
  • Why use PHP? Why not just use a off-the-shelve free proxy? – Milo van der Zee Jul 19 '20 at 10:16
  • 1. I just wanna learn if PHP has that functionality. 2. I want to build the whole new website in php and only for videos, write a function that proxies them. So simple proxying won't be a good solution. 3. In country that I'm targeting there are no good proxy services or they cost a lot – Giorgi Cercvadze Jul 19 '20 at 10:23
  • This can be done via PHP stream context as noted in the [answer](https://stackoverflow.com/a/18271545/5859088) – Giorgi Cercvadze Jul 28 '20 at 17:03

0 Answers0