Class
HostList

The HostList allows fast determination of whether a given host is in the list. It supports leading wildcards (e.g. *.foo.com), and the special tokens <local> <nonlocal> and <loopback>. Note: List is not threadsafe; instead of updating it, construct a new one.

Definition

Namespace:Fiddler

Assembly:FiddlerCore.dll

Syntax:

cs-api-definition
public class HostList

Inheritance: objectHostList

Inherited Members object.GetType()object.MemberwiseClone()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()

Constructors

HostList()

Generate an empty HostList

Declaration

cs-api-definition
public HostList()

HostList(string)

Create a hostlist and assign it an initial set of sites

Declaration

cs-api-definition
public HostList(string sInitialList)

Parameters

sInitialList

string

List of hostnames, including leading wildcards, and optional port specifier. Special tokens are *, <local>, <nonlocal>, and <loopback>.

Methods

AssignFromString(string)

Clear the List and assign the new string as the contents of the list.

Declaration

cs-api-definition
public bool AssignFromString(string sIn)

Parameters

sIn

string

List of hostnames, including leading wildcards, and optional port specifier. Special tokens are *, <local>, <nonlocal>, and <loopback>.

Returns

bool

TRUE if the list was constructed without errors

AssignFromString(string, out string)

Clear the list and assign the new string as the contents of the list.

Declaration

cs-api-definition
public bool AssignFromString(string sIn, out string sErrors)

Parameters

sIn

string

List of hostnames, including leading wildcards, and optional port specifier. Special tokens are *, <local>, <nonlocal>, and <loopback>.

sErrors

string

Outparam string containing list of parsing errors

Returns

bool

TRUE if the list was constructed without errors

Clear()

Clear the HostList

Declaration

cs-api-definition
public void Clear()

ContainsHost(string)

Determine if a given Host is in the list

Declaration

cs-api-definition
public bool ContainsHost(string sHost)

Parameters

sHost

string

A Host string, potentially including a port

Returns

bool

TRUE if the Host's hostname matches a rule in the list

ContainsHost(string, int)

Determine if a given Host:Port pair matches an entry in the list

Declaration

cs-api-definition
public bool ContainsHost(string sHostname, int iPort)

Parameters

sHostname

string

A hostname, NOT including the port

iPort

int

The port

Returns

bool

TRUE if the hostname matches a rule in the list

ContainsHostname(string)

Determine if a given Hostname is in the list

Declaration

cs-api-definition
public bool ContainsHostname(string sHostname)

Parameters

sHostname

string

A hostname, NOT including a port

Returns

bool

TRUE if the hostname matches a rule in the list

ToString()

Return the current list of rules as a string

Declaration

cs-api-definition
public override string ToString()

Returns

string

String containing current rules, using "; " as a delimiter between entries

Overrides object.ToString()