Class Proxy
The core proxy object which accepts connections from clients and creates session objects from those connections.
Inheritance
Inherited Members
Namespace: Fiddler
Assembly: FiddlerCore.dll
Syntax
public class Proxy : IDisposable
Properties
IsAttached
Returns true if Fiddler believes it is currently registered as the Local System proxy
Declaration
public bool IsAttached { get; set; }
Property Value
System.Boolean
|
IsListening
Returns true if the proxy is listening on a port.
Declaration
public bool IsListening { get; }
Property Value
System.Boolean
|
ListenPort
The port on which this instance is listening
Declaration
public int ListenPort { get; }
Property Value
System.Int32
|
Methods
AssignEndpointCertificate(X509Certificate2)
Assign HTTPS Certificate for this endpoint
Declaration
public void AssignEndpointCertificate(X509Certificate2 certHTTPS)
Parameters
System.Security.Cryptography.X509Certificates.X509Certificate2
certHTTPS
Certificate to return to clients who connect |
Attach()
Register as the system proxy for WinINET and set the Dynamic registry key for other FiddlerHook
Declaration
public bool Attach()
Returns
System.Boolean
True if the proxy registration was successful |
Detach()
Detach the proxy by setting the registry keys and sending a Windows Message
Declaration
public bool Detach()
Returns
System.Boolean
True if the proxy settings were successfully detached |
Dispose()
Dispose Fiddler's listening socket
Declaration
public void Dispose()
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
System.String
sURIScheme
URIScheme: use http, https, or ftp |
System.String
sHostAndPort
Host for which to return gateway information |
Returns
System.Net.IPEndPoint
IPEndPoint of gateway to use, or NULL |
InjectCustomRequest(HTTPRequestHeaders, Byte[], Boolean, Boolean)
Declaration
public void InjectCustomRequest(HTTPRequestHeaders oHeaders, byte[] arrRequestBodyBytes, bool bRunRequestRules, bool bViewResult)
Parameters
HTTPRequestHeaders
oHeaders
|
System.Byte[]
arrRequestBodyBytes
|
System.Boolean
bRunRequestRules
|
System.Boolean
bViewResult
|
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
HTTPRequestHeaders
oHeaders
HTTP Request Headers |
System.Byte[]
arrRequestBodyBytes
HTTP Request body (or null) |
System.Collections.Specialized.StringDictionary
oNewFlags
StringDictionary of Session Flags (or null) |
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
System.String
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
System.String
sRequest
String representing the HTTP request. If headers only, be sure to end with CRLFCRLF |
System.Collections.Specialized.StringDictionary
oNewFlags
StringDictionary of Session Flags (or null) |
OnDetachedUnexpectedly()
Declaration
protected virtual void OnDetachedUnexpectedly()
PurgeServerPipePool()
Clear the pool of Server Pipes. May be called by extensions.
Declaration
public void PurgeServerPipePool()
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
HTTPRequestHeaders
oHeaders
HTTP Request Headers |
System.Byte[]
arrRequestBodyBytes
HTTP Request body (or null) |
System.Collections.Specialized.StringDictionary
oNewFlags
StringDictionary of Session Flags (or null) |
Returns
Session
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
HTTPRequestHeaders
oHeaders
HTTP Request Headers |
System.Byte[]
arrRequestBodyBytes
HTTP Request body (or null) |
System.Collections.Specialized.StringDictionary
oNewFlags
StringDictionary of Session Flags (or null) |
System.EventHandler<StateChangeEventArgs>
onStateChange
Event Handler to notify when the session changes state |
Returns
Session
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
System.String
sRequest
String representing the HTTP request. If headers only, be sure to end with CRLFCRLF |
System.Collections.Specialized.StringDictionary
oNewFlags
StringDictionary of Session Flags (or null) |
Returns
Session
The new session |
SendRequestAndWait(HTTPRequestHeaders, Byte[], StringDictionary, EventHandler<StateChangeEventArgs>)
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
HTTPRequestHeaders
oHeaders
|
System.Byte[]
arrRequestBodyBytes
|
System.Collections.Specialized.StringDictionary
oNewFlags
|
System.EventHandler<StateChangeEventArgs>
onStateChange
|
Returns
Session
|
ToString()
Returns a string of information about this instance and the ServerPipe reuse pool
Declaration
public override string ToString()
Returns
System.String
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 Type
System.EventHandler
|