using System;
using System.Net;
namespace TMDbLib.Utilities
{
///
/// Represents a Web Proxy to use for TMDb API Requests.
///
///
/// This is a very simple implementation of a Web Proxy to be used when requesting data from TMDb API.
/// It does not support proxy bypassing or multi-proxy configuration based on the destination URL, for instance.
///
public class TMDbAPIProxy : IWebProxy
{
private readonly Uri _proxyUri;
///
/// Initializes a new instance for this Proxy
///
public TMDbAPIProxy(Uri proxyUri, ICredentials credentials = null)
{
if (proxyUri == null)
throw new ArgumentNullException(nameof(proxyUri));
_proxyUri = proxyUri;
Credentials = credentials;
}
///
/// Gets or sets the credentials to use for authenticating in the proxy server.
///
public ICredentials Credentials { get; set; }
///
/// Gets the proxy server to be used when accessing .
///
/// The destination URL to be accessed.
///
public Uri GetProxy(Uri destination)
{
return _proxyUri;
}
public bool IsBypassed(Uri host)
{
return false;
}
}
}