latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Fix for rtmp streaming with CloudFront

Home Forums Community Forum Unofficial Extensions/Hacks Fix for rtmp streaming with CloudFront

This topic contains 3 replies, has 3 voices. Last updated by  Mathieu Virbel 4 years, 7 months ago.

Topic Author Topic
Posted: Tuesday May 15th, 2012 at 8:13 pm #13577
Mathieu Virbel
Username: mat

Hi,

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:

https://gist.github.com/2706125

I hope that will be resolved soon :)

Mathieu

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Wednesday May 16th, 2012 at 4:29 am #13640

Hi Mathieu.

Thanks so much for sharing that!

I’ll show it to Jason too.

Thanks! :)

Posted: Thursday May 17th, 2012 at 6:52 pm #13818
Staff Member

Thanks for the heads up on this request for support.

While I completely the understand the desire for this, s2Member really needs to stick with a standard here. The $_SERVER["REMOTE_ADDR"] is an environment variable that servers need to be configured with. I’m aware that some servers are NOT properly configured, but there are ways to deal with this at the server/hosting level.

I posted some additional details regarding this issue here, along with a popular workaround.
http://www.primothemes.com/forums/viewtopic.php?t=6380&p=14606#p14618

Posted: Thursday May 17th, 2012 at 9:00 pm #13832
Mathieu Virbel
Username: mat

As soon as you use wordpress in a multiple webserver environment using a proxy as a frontend, you’ll have the issue.

I understand why you want to stick on it (after reading your forum post), but would it be possible to make this behavior as a setting checkbox then ? Because _everytime_ that we want to upgrade s2, we also need to re-apply the patch..

I could provide a patch for a setting checkbox if you would agreed to merge it :)

Viewing 3 replies - 1 through 3 (of 3 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.