Leadtools.Multimedia Namespace : RTSPSecurity Class |
'Declaration Public Class RTSPSecurity Implements System.IDisposable
'Usage Dim instance As RTSPSecurity
public class RTSPSecurity : System.IDisposable
public ref class RTSPSecurity : public System.IDisposable
RTSP Servers use security that is similar to that used in HTML servers and is based on authentication. The authentication methods rely on the server specifying a username and a password pair with the right to access a certain Media file.
There are two authentication methods:
From a performance standpoint, the two authentication methods have roughly the same speed. So the method you choose depends on how secure you want your server to be and in what kind of authentication is supported in your client.
The LEAD RTSP Server supports both authentication methods.
Authentication is optional, you do not need to use it unless your application requires it.
If you don't do anything, the server will not restrict access.
To implement security, you create a RTSPSecurity object and set it to the RTSPServer object using RTSPServer.SetSecurity The RTSPServer object keeps a reference to the actual RTSPSecurity object, so if you add/remove users to the the RTSPSecurity object after you set it to the RTSPServer object, these changes will be reflected in the security settings for that RTSPServer instance.
To implement different security settings for each file, you create a different RTSPSecurity object for each session.
To use the same security settings for all the files, you can create one RTSPSecurity object and use it for every session you create.
In general, you need to do the following:
Imports Leadtools Imports Leadtools.Multimedia Imports LeadtoolsMultimediaExamples.Fixtures Public Sub SetSecurity() Dim security As RTSPSecurity = New RTSPSecurity() security.RealmName = "MyRTSPServer" security.AuthenticationRequired = RTSPAuthenticationType.Basic security.AddUser("TestUser", "TestPassword") _server.SetSecurity(-1, security) End Sub
using Leadtools; using Leadtools.Multimedia; using LeadtoolsMultimediaExamples.Fixtures; public void SetSecurity() { RTSPSecurity security = new RTSPSecurity(); security.RealmName = "MyRTSPServer"; security.AuthenticationRequired = RTSPAuthenticationType.Basic; security.AddUser("TestUser", "TestPassword"); _server.SetSecurity(-1, security); }