[Red5] Receive video stream only from a single ip.
Mauro
mrsanna1 at gmail.com
Tue Sep 29 02:06:53 PDT 2009
2009/9/25 Mondain <mondain at gmail.com>:
> Override streamPublishStart in your application adapter and look at the
> origin IP on the connection, reject it if it doesn't match. Something like
> this may work..
> <pre>
> @Override
> public void streamPublishStart(IBroadcastStream stream) {
> IConnection connection = Red5.getConnectionLocal();
> String remoteAddress = connection.getRemoteAddress();
> log.debug("Remote address: {}", remoteAddress);
> if ("192.168.8.6".equals(remoteAddress)) {
> log.debug("Publish approved");
> super.streamPublishStart(stream);
> } else {
> log.warn("Publish disapproved from {}", remoteAddress);
> super.rejectClient("Publish from this location not allowed");
> }
> }
> </pre>
I've seen streamPublishStart method of MultiThreadedApplicationAdapter class.
The source is:
public void streamPublishStart(IBroadcastStream stream) {
IConnection connection = Red5.getConnectionLocal();
log.info( "W3C x-category:stream x-event:publish c-ip:{} x-sname:{}
x-name:{}",
new Object[] {
connection != null ? connection.getRemoteAddress() : "0.0.0.0",
stream.getName(), stream.getPublishedName() });
}
I don't well undestand what new Object[] stands for.
If I override this method I've to put ip control under new Object definition?
More information about the Red5
mailing list