• Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop
    Web
    Kendo UI UI for jQuery UI for Angular UI for React UI for Vue UI for ASP.NET AJAX UI for ASP.NET MVC UI for ASP.NET Core UI for Blazor UI for Silverlight UI for PHP UI for JSP
    Mobile
    UI for .NET MAUI UI for Xamarin
    Document Management
    Telerik Document Processing
    Desktop
    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF UI for UWP
    Reporting & Mocking
    Telerik Reporting Telerik Report Server Telerik JustMock
    Automated Testing
    Test Studio Test Studio Dev Edition
    CMS
    Sitefinity
    UI/UX Design
    Unite UX
    Debugging
    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Jam FiddlerCap FiddlerCore
    Extended Reality
    UI for Unity XR
    Free Tools
    JustAssembly JustDecompile VB.NET to C# Converter Testing Framework
    View all products
  • Overview
    • jQuery
    • Angular
    • React
    • Vue
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Docs & Support
  • Pricing
  • Search
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class Proxy

The core proxy object which accepts connections from clients and creates session objects from those connections.

Inheritance
System.Object
Proxy
Namespace: Fiddler
Assembly: FiddlerCore.dll

Syntax

public class Proxy : Object, 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(out String)

Register as the system proxy for WinINET and set the Dynamic registry key for other FiddlerHook

Declaration
public bool Attach(out string error)
Parameters
System.String error

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

GetWpadUrl()

Get WPAD-discovered URL

Declaration
public string GetWpadUrl()
Returns
System.String

A WPAD url, if found, null or string.Empty otherwise

InjectCustomRequest(HTTPRequestHeaders, Byte[], Boolean, Boolean)

[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, bool bRunRequestRules, bool bViewResult)
Parameters
HTTPRequestHeaders oHeaders

HTTP Request Headers

System.Byte[] arrRequestBodyBytes

HTTP Request body (or null)

System.Boolean bRunRequestRules

Unused

System.Boolean bViewResult

Sets a flag to be used later when inspecting the session

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()

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.

Declaration
public Task PurgeServerPipePoolAsync()
Returns
System.Threading.Tasks.Task

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>)

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
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

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

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

Getting Started
  • Try Now
Community
  • Forums
  • Blogs
  • Feedback Portal

Copyright © 2019 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.