public Session(OpenVidu openVidu) { _logger = ApplicationLogging.createLogger("Session"); this._openVidu = openVidu; this._properties = new SessionPropertiesBuilder().build(); Task.Run(async() => await getSessionIdHttp()).Wait(); }
public OpenVidu(string hostname, string secret) { _logger = ApplicationLogging.createLogger("OpenVidu"); this.Hostname = hostname; if (!this.Hostname.EndsWith("/")) { this.Hostname += "/"; } this._secret = secret; HttpClient = new HttpClient(); var authInfo = $"OPENVIDUAPP:{this._secret}"; authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo)); HttpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authInfo); HttpClient.BaseAddress = new Uri(Hostname); HttpClient.Timeout = TimeSpan.FromMilliseconds(300000); }