|Posted: Tuesday May 15th, 2012 at 8:13 pm #13577|
During testing the s2member plugin, i wanted to display a video.mp4, using CloudFront. we went over the video tutorial, but we hit the issue “Stream not found” During the rtmp transaction, the server just return us “NetStream.Failed”. After some hours of debugging (i was new to Amazon S3, CloudFront, S2member), i’ve found the error, and i want to share it.
Our website is served via an Elastic Load Balancer. When s2member generate rtmp/CloudFront policy, it include an IP restriction, using $_SERVER[‘REMOTE_ADDR’]. But the IP in this one is the IP of Elastic Load Balancer, not the IP of the client. At the end, the generated url contain an invalid restriction, and lead to the NetStream.Failed.
Here is a patch to use HTTP_X_FORWARDED_FOR if it exist, and supersede REMOTE_ADDR:
I hope that will be resolved soon :)
- s2Member® Products