// %BANNER_BEGIN%
// ---------------------------------------------------------------------
// %COPYRIGHT_BEGIN%
// Copyright (c) (2018-2022) Magic Leap, Inc. All Rights Reserved.
// Use of this file is governed by the Software License Agreement, located here: https://www.magicleap.com/software-license-agreement-ml2
// Terms and conditions applicable to third-party materials accompanying this distribution may also be found in the top-level NOTICE file appearing herein.
// %COPYRIGHT_END%
// ---------------------------------------------------------------------
// %BANNER_END%
namespace UnityEngine.XR.MagicLeap
{
///
/// MLWebRTC class contains the API to interface with the
/// WebRTC C API.
///
public partial class MLWebRTC
{
///
/// Protocol for the forward proxy.
///
public enum ProxyType
{
Https,
Socks5
}
///
/// Class that represents an ice server used by the MLWebRTC API.
///
public partial struct ProxyConfig
{
///
/// Gets the type of this proxy config.
///
public ProxyType Type { get; private set; }
///
/// Gets the proxy server address.
///
public string HostAddress { get; private set; }
///
/// Gets the proxy server port.
///
public int HostPort { get; private set; }
///
/// Gets the username to authenticate the proxy server.
///
public string Username { get; private set; }
///
/// Gets the password to authenticate the proxy server.
///
public string Password { get; private set; }
///
/// Whether the proxy will be auto-detected.
///
public bool AutoDetect { get; private set; }
///
/// Gets url to use for downloading proxy config.
///
public string AutoConfigUrl { get; private set; }
///
/// Gets urls which should bypass the proxy.
///
public string BypassList { get; private set; }
///
/// Factory method used to create a new IceServer object.
///
/// The uri of the ice server.
/// The username to log into the ice server.
/// The password to log into the ice server.
/// An ice candidate object with the given handle.
public static ProxyConfig Create(ProxyType type, string hostAddress, int hostPort, string userName = null, string password = null, bool autoDetect = false, string autoConfigUrl = null, string bypassList = null)
{
ProxyConfig proxyConfig = new ProxyConfig()
{
Type = type,
HostAddress = hostAddress,
HostPort = hostPort,
Username = userName,
Password = password,
AutoDetect = autoDetect,
AutoConfigUrl = autoConfigUrl,
BypassList = bypassList
};
return proxyConfig;
}
public override string ToString()
{
return $"Type: {Type}, Host: {HostAddress}:{HostPort}, Auth: {Username}:{Password},\nAutoDetect: {AutoDetect}, AutoConfigUrl: {AutoConfigUrl}, BypassList: {BypassList}";
}
}
}
}