Skip to main content
September 30, 2014
Answered

Filter by IP Range for VODs?

  • September 30, 2014
  • 2 replies
  • 1371 views

Is there any way to only allow a certain IP range to views VODs in a specific application on the server? In main.asc I tried getting the client.ip but it only returns 127.0.0.1 as the address, which I assume is because the video player is hosted on the server itself. Is there any way to get the IP address of the actual user? We want to be able to limit users to viewing certain videos while they are within a certain subnet. Thanks!

This topic has been closed for replies.
Correct answer

No, this was accessed by using the server's URL from a different computer, one that isn't even on the same subnet of the AMS. I used the sample player/file because it was a fresh install. One note though, when accessing the VOD from the AMS itself, it'll actually show the server's IP rather than 127.0.0.1.


Found it! I needed port 1935 opened in the firewall. I guess with it blocked off, RTMP goes in through a different route. It took me longer to realize because our workplace has another firewall that blocks all ports, so even with the server ports open, it was still showing 127.0.0.1, but now I can see the correct IPs of the clients.

2 replies

Adobe Employee
October 10, 2014

I wrote a small auth adaptor and it returns correct IP address(just as expected)...I am attaching the debugger screen shot as a proof of that...

October 10, 2014

Interesting. Are you using AMS v5? Your screenshot gave me an idea to try it on our older, existing AMS server (which is FMS 3.5) and currently running on Windows server 2008 R2. It's pulling the client IP correctly on it! The server that it's not working on is Red Hat Enterprise Linux Server release 6.5 (Santiago). Now to know if it's the current release of AMS that's not working or if it's something related to the linux-side of things.

October 10, 2014

New update: I just installed the latest AMS on Windows Server 2008 R2 and I'm still getting the 127.0.0.1 as the client IP. This was a fresh install. Here's a screenshot of the admin console. So it looks like it may not be working as intended on the latest version? The only one I could see the client's IP address was the existing FMS 3.5 that we had.

Conor Brennan
Adobe Employee
Adobe Employee
September 30, 2014

Option 1:

General IP Blocking can be done in the Adobe Media Server config.

Open the Adaptor.xml in your conf/-Folder and change the Allow/Deny entries.

Here's the documentation:

http://help.adobe.com/en_US/flashmediaserver/configadmin/WS5b3ccc516d4fbf351e63e3d119f2926583-7ffb.html

Option 2:

Server side actionscript provides you a more fine grained access control. Use the application.onConnect function and verify the IP adress by accessing it with Client.ip property.

Here's the documentation:

Adobe Media Server 5.0.3 * Server-Side ActionScript Language Reference

Either of these work for you ?

Thanks/

September 30, 2014

For Option 1, we only want to limit a subset of videos by IP range and this method seems to only allow an IP range for the entire server. Correct me if I'm wrong.

For Option 2, I mentioned above. We used the application.onConnect function in main.asc, as such:

application.onConnect = function( p_client, p_autoSenseBW )

{

     trace("Checking ip of client: " + p_client.ip);

...

}

In the logs, this always outputs: "Checking ip of client: 127.0.0.1" regardless if I'm viewing the video from home or at work. We use another webserver that hosts the embed code for the video, but the media server hosts both the flv file and the video player.

Conor Brennan
Adobe Employee
Adobe Employee
October 1, 2014

You could create a new Adaptor (or VHost) and limit the IPs just for that Adaptor using the <allow/> tag.

But you would need to bind that Adaptor to a new HostPort instance and then ensure that clients are accessing the VOD app from the correct Adaptor or VHost. This would not be the best way to do this.

The best method would be to use the Adobe Access or Authorization plugin

please see here for more details:

Adobe Media Server 5.0.6 * Developing an Access plug-in

Thanks/