ClassProxy
The core proxy object which accepts connections from clients and creates session objects from those connections.
Definition
Namespace:Fiddler
Assembly:FiddlerCore.dll
Syntax:
public class Proxy : IDisposable
Inheritance: objectProxy
Implements:
Inherited Members
Properties
IsAttached
Returns true if Fiddler believes it is currently registered as the Local System proxy
Declaration
[Obsolete("Use Telerik.NetworkConnections.NetworkConnectionsManager.GetCurrentProxySettingsForConnection(*)/SetProxySettingsForConnections(*) to manipulate current proxy settings.")]
public bool IsAttached { get; set; }
Property Value
IsListening
Returns true if the proxy is listening on a port.
ListenPort
The port on which this instance is listening
Methods
AssignEndpointCertificate(X509Certificate2)
Assign HTTPS Certificate for this endpoint
Declaration
public void AssignEndpointCertificate(X509Certificate2 certHTTPS)
Parameters
certHTTPS
Certificate to return to clients who connect
Attach(out string)
Register as the system proxy for WinINET and set the Dynamic registry key for other FiddlerHook
Declaration
[Obsolete("Use Telerik.NetworkConnections.NetworkConnectionsManager.GetCurrentProxySettingsForConnection(*)/SetProxySettingsForConnections(*) to manipulate current proxy settings.")]
public bool Attach(out string error)
Parameters
error
Returns
True if the proxy registration was successful
Detach()
Detach the proxy by setting the registry keys and sending a Windows Message
Declaration
[Obsolete("Use Telerik.NetworkConnections.NetworkConnectionsManager.GetCurrentProxySettingsForConnection(*)/SetProxySettingsForConnections(*) to manipulate current proxy settings.")]
public bool Detach()
Returns
True if the proxy settings were successfully detached
Dispose()
Dispose Fiddler's listening socket
Declaration
public void Dispose()
Implements
FindGatewayForOrigin(string, string)
This function, when given a scheme host[:port], returns the gateway information of the proxy to forward requests to.
Declaration
public IPEndPoint FindGatewayForOrigin(string sURIScheme, string sHostAndPort)
Parameters
sURIScheme
URIScheme: use http, https, or ftp
sHostAndPort
Host for which to return gateway information
Returns
IPEndPoint of gateway to use, or NULL
GetWpadUrl()
Get WPAD-discovered URL
Declaration
public string GetWpadUrl()
Returns
A WPAD url, if found, null or string.Empty otherwise
InjectCustomRequest(HTTPRequestHeaders, byte[], StringDictionary)
[DEPRECATED] Directly inject a session into the Fiddler pipeline. NOTE: This method will THROW any exceptions to its caller.
Declaration
public void InjectCustomRequest(HTTPRequestHeaders oHeaders, byte[] arrRequestBodyBytes, StringDictionary oNewFlags)
Parameters
oHeaders
HTTP Request Headers
arrRequestBodyBytes
byte[]
HTTP Request body (or null)
oNewFlags
StringDictionary of Session Flags (or null)
InjectCustomRequest(HTTPRequestHeaders, byte[], bool, bool)
[DEPRECATED] Directly inject a session into the Fiddler pipeline. NOTE: This method will THROW any exceptions to its caller.
Declaration
[Obsolete("This overload of InjectCustomRequest is obsolete. Use a different version.", true)]
public void InjectCustomRequest(HTTPRequestHeaders oHeaders, byte[] arrRequestBodyBytes, bool bRunRequestRules, bool bViewResult)
Parameters
oHeaders
HTTP Request Headers
arrRequestBodyBytes
byte[]
HTTP Request body (or null)
bRunRequestRules
Unused
bViewResult
Sets a flag to be used later when inspecting the session
InjectCustomRequest(string)
[DEPRECATED]: This version does no validation of the request data, and doesn't set SessionFlags.RequestGeneratedByFiddler Send a custom HTTP request to Fiddler's listening endpoint (127.0.0.1:8888 by default). NOTE: This method will THROW any exceptions to its caller and blocks the current thread.
Declaration
public void InjectCustomRequest(string sRequest)
Parameters
sRequest
String representing the HTTP request. If headers only, be sure to end with CRLFCRLF
InjectCustomRequest(string, StringDictionary)
[DEPRECATED] Directly inject a session into the Fiddler pipeline. NOTE: This method will THROW any exceptions to its caller.
Declaration
public void InjectCustomRequest(string sRequest, StringDictionary oNewFlags)
Parameters
sRequest
String representing the HTTP request. If headers only, be sure to end with CRLFCRLF
oNewFlags
StringDictionary of Session Flags (or null)
OnDetachedUnexpectedly()
Raise the DetachedUnexpectedly event so the UI can react to Fiddler no longer registered as the system proxy.
Declaration
protected virtual void OnDetachedUnexpectedly()
PurgeServerPipePoolAsync()
Clear the pool of Server Pipes. May be called by extensions.
SendRequest(HTTPRequestHeaders, byte[], StringDictionary)
Directly inject a session into the Fiddler pipeline, returning a reference to it. NOTE: This method will THROW any exceptions to its caller.
Declaration
[CodeDescription("Send a custom request through the proxy. Hook the OnStateChanged event of the returned Session to monitor progress")]
public Session SendRequest(HTTPRequestHeaders oHeaders, byte[] arrRequestBodyBytes, StringDictionary oNewFlags)
Parameters
oHeaders
HTTP Request Headers
arrRequestBodyBytes
byte[]
HTTP Request body (or null)
oNewFlags
StringDictionary of Session Flags (or null)
Returns
The new Session
SendRequest(HTTPRequestHeaders, byte[], StringDictionary, EventHandler<StateChangeEventArgs>)
Directly inject a session into the Fiddler pipeline, returning a reference to it. NOTE: This method will THROW any exceptions to its caller.
Declaration
[CodeDescription("Send a custom request through the proxy. Hook the OnStateChanged event of the returned Session to monitor progress")]
public Session SendRequest(HTTPRequestHeaders oHeaders, byte[] arrRequestBodyBytes, StringDictionary oNewFlags, EventHandler<StateChangeEventArgs> onStateChange)
Parameters
oHeaders
HTTP Request Headers
arrRequestBodyBytes
byte[]
HTTP Request body (or null)
oNewFlags
StringDictionary of Session Flags (or null)
onStateChange
EventHandler<StateChangeEventArgs>
Event Handler to notify when the session changes state
Returns
The new Session
SendRequest(string, StringDictionary)
Directly inject a session into the Fiddler pipeline, returning a reference to it. NOTE: This method will THROW any exceptions to its caller.
Declaration
public Session SendRequest(string sRequest, StringDictionary oNewFlags)
Parameters
sRequest
String representing the HTTP request. If headers only, be sure to end with CRLFCRLF
oNewFlags
StringDictionary of Session Flags (or null)
Returns
The new session
SendRequestAndWait(HTTPRequestHeaders, byte[], StringDictionary, EventHandler<StateChangeEventArgs>)
Directly injects a session into the Fiddler pipeline, waits for it to finish (Done or Aborted) and returns a reference to it. NOTE: This method will THROW any exceptions to its caller.
Declaration
[CodeDescription("Send a custom request through the proxy, blocking until it completes (or aborts).")]
public Session SendRequestAndWait(HTTPRequestHeaders oHeaders, byte[] arrRequestBodyBytes, StringDictionary oNewFlags, EventHandler<StateChangeEventArgs> onStateChange)
Parameters
oHeaders
HTTP Request Headers
arrRequestBodyBytes
byte[]
HTTP Request body (or null)
oNewFlags
StringDictionary of Session Flags (or null)
onStateChange
EventHandler<StateChangeEventArgs>
Event Handler to notify when the session changes state
Returns
The new Session
ToString()
Returns a string of information about this instance and the ServerPipe reuse pool
Declaration
public override string ToString()
Returns
A multiline string
Overrides
Events
DetachedUnexpectedly
This event handler fires when Fiddler detects that it is (unexpectedly) no longer the system's registered proxy
Declaration
public event EventHandler DetachedUnexpectedly
Event Value