0

I am using open source streaming server Red5 on multiple servers. Which are running behind a bastion host.

the world knows these sites as

http://site1.mydomain.com
http://site2.mydomain.com
http://site3.mydomain.com
http://site4.mydomain.com

To reach the front end server is using Apache Reverse Proxy.

I am also having video streaming on each of these websites using rtmp.

To be able to reach the streaming server I embed a javascript in HTML pages as follows Code:

<embed .....
var="rtmp://site1.my_domain.com"
>

the problem is the website are many

site1.mydomain.com
site2.mydomain.com
site3.mydomain.com
site4.mydomain.com

each on a separate physical server. Each of these four have their own Red5 installations the front end to each of these four is a common Bastion Host.

If I run rtmp on each of the subdomains at a different port

how will I make sure a request such as

rtmp://site1.mydomain.com
rtmp://site2.mydomain.com

goes to their respective servers. from the front end server. What do I need to handle in this case ?

IPTABLES came to mind instantly but from the client browser on internet when some one requests

rtmp://site1.mydomain.com

how will I make sure this rtmp request is mapped to a port different than 1935 as there are three other streaming servers which are also to respond to their respective requests ?

1 Answer 1

0

If your users are only contacting the rtmp servers via the code (as opposed to typing in the URL manually themselves, you can simply specify the proper port number in the URL itself.

For exmaple:

rtmp://site1.mydomain.com:1935
rtmp://site2.mydomain.com:1936
rtmp://site3.mydomain.com:1937
rtmp://site4.mydomain.com:1938

Attempting to do such a redirection via iptables is non-trivial. The TCP/IP headers which iptables works with contain no trace of the DNS lookup that was done to arrive at the IP address contained within the headers.

Depending on the protocol format of RTMP (which I'm not familiar with), you may be able to something like the l7-filter project to create filter rules that inspect the payload. However, note that it's not part of the standard Linux kernel, requiring you to patch and roll your own.

2
  • I understand your solution some how we have that precision to use it on 1935. Also all these websites are not Load Balancing websites they are different ones.I came across some thing known as Layer 7 firewall for this scenario. I am using Linux for that can you suggest some thing. So that based on hostname part the URL could be redirected to different places by gateway.
    – Bond
    Aug 10, 2010 at 1:37
  • In the last paragraph of my answer I mentioned and linked to the l7-filter project. That project provides the "layer 7 firewall" functionality you're inquiring about. I still think the simplest solution is to include the ports in the URL within the Javascript code. Is there some reason you can't specify the port in your code? You said yourself that each service is running on a different port. ("If I run rtmp on each of the subdomains at a different port.")
    – chuckx
    Aug 10, 2010 at 14:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .