Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppCurrent)-browser;$(NetCoreAppCurrent)-wasi</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<UseCompilerGeneratedDocXmlFile>false</UseCompilerGeneratedDocXmlFile>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,39 @@

namespace System.Net
{
/// <summary>
/// Provides the base interface to load and execute scripts for automatic proxy detection.
/// </summary>
public interface IWebProxyScript
{
/// <summary>
/// Closes a script.
/// </summary>
void Close();

/// <summary>
/// Loads a script.
/// </summary>
/// <param name="scriptLocation">The URI that identifies the location of the proxy auto-configuration script.</param>
/// <param name="script">The script content to load and prepare for execution.</param>
/// <param name="helperType">The type that provides helper methods or services available to the script at runtime.</param>
/// <returns>A <see cref="bool"/> indicating whether the script was successfully loaded.</returns>
bool Load(Uri scriptLocation, string script, Type helperType);

/// <summary>
/// Runs a script.
/// </summary>
/// <param name="url">The destination URL for which proxy information is requested.</param>
/// <param name="host">The host name associated with the destination URL.</param>
/// <returns>
/// A <see cref="string"/> that describes how to connect to the destination, such as a proxy configuration directive (for example, <c>"DIRECT"</c> or <c>"PROXY host:port"</c>).
/// </returns>
/// <remarks>
/// <para>
/// When the object is run, it might need to run the WPAD (Web Proxy Automatic Detection) protocol to detect whether a proxy is required for reaching the destination URL.
/// During this process, the system downloads and compiles the PAC (Proxy Auto-Configuration) script in memory and tries to execute the FindProxyForURL function as per the PAC specification.
/// </para>
/// </remarks>
string Run(string url, string host);
}
}
Loading
Loading