Skip to content

Commit ef87718

Browse files
authored
Merge pull request #2 from telerik/niliev/update
docs: update demos
2 parents a1f0950 + a3d2c49 commit ef87718

File tree

7 files changed

+79
-25
lines changed

7 files changed

+79
-25
lines changed
Binary file not shown.

CaptureTraffic/NetFramework/CaptureTraffic/CaptureTraffic.csproj

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,27 @@
88
<OutputType>Exe</OutputType>
99
<RootNamespace>CaptureTraffic</RootNamespace>
1010
<AssemblyName>CaptureTraffic</AssemblyName>
11-
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
11+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
1212
<FileAlignment>512</FileAlignment>
1313
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1414
<TargetFrameworkProfile />
1515
<NuGetPackageImportStamp>
1616
</NuGetPackageImportStamp>
17+
<PublishUrl>publish\</PublishUrl>
18+
<Install>true</Install>
19+
<InstallFrom>Disk</InstallFrom>
20+
<UpdateEnabled>false</UpdateEnabled>
21+
<UpdateMode>Foreground</UpdateMode>
22+
<UpdateInterval>7</UpdateInterval>
23+
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
24+
<UpdatePeriodically>false</UpdatePeriodically>
25+
<UpdateRequired>false</UpdateRequired>
26+
<MapFileExtensions>true</MapFileExtensions>
27+
<ApplicationRevision>0</ApplicationRevision>
28+
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
29+
<IsWebBootstrapper>false</IsWebBootstrapper>
30+
<UseApplicationTrust>false</UseApplicationTrust>
31+
<BootstrapperEnabled>true</BootstrapperEnabled>
1732
</PropertyGroup>
1833
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1934
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -24,6 +39,7 @@
2439
<DefineConstants>DEBUG;TRACE</DefineConstants>
2540
<ErrorReport>prompt</ErrorReport>
2641
<WarningLevel>4</WarningLevel>
42+
<Prefer32Bit>false</Prefer32Bit>
2743
</PropertyGroup>
2844
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2945
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -33,6 +49,7 @@
3349
<DefineConstants>TRACE</DefineConstants>
3450
<ErrorReport>prompt</ErrorReport>
3551
<WarningLevel>4</WarningLevel>
52+
<Prefer32Bit>false</Prefer32Bit>
3653
</PropertyGroup>
3754
<ItemGroup>
3855
<Reference Include="BCMakeCert, Version=2.0.9.0, Culture=neutral, PublicKeyToken=67cb91587178ac5a, processorArchitecture=MSIL">
@@ -41,14 +58,23 @@
4158
<Reference Include="DotNetZip, Version=1.13.4.0, Culture=neutral, PublicKeyToken=6583c7c814667745, processorArchitecture=MSIL">
4259
<HintPath>..\packages\DotNetZip.1.13.4\lib\net40\DotNetZip.dll</HintPath>
4360
</Reference>
44-
<Reference Include="FiddlerCore, Version=5.0.1.0, Culture=neutral, PublicKeyToken=67cb91587178ac5a, processorArchitecture=MSIL">
45-
<HintPath>..\packages\FiddlerCore.5.0.1\lib\net40\FiddlerCore.dll</HintPath>
61+
<Reference Include="FiddlerCore, Version=5.0.2.0, Culture=neutral, PublicKeyToken=67cb91587178ac5a, processorArchitecture=MSIL">
62+
<HintPath>..\packages\FiddlerCore.5.0.2\lib\net45\FiddlerCore.dll</HintPath>
63+
</Reference>
64+
<Reference Include="Microsoft.Win32.Registry, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
65+
<HintPath>..\packages\Microsoft.Win32.Registry.4.5.0\lib\net461\Microsoft.Win32.Registry.dll</HintPath>
4666
</Reference>
4767
<Reference Include="System" />
4868
<Reference Include="System.ComponentModel.Composition" />
4969
<Reference Include="System.Configuration" />
5070
<Reference Include="System.Core" />
5171
<Reference Include="Microsoft.CSharp" />
72+
<Reference Include="System.Security.AccessControl, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
73+
<HintPath>..\packages\System.Security.AccessControl.4.5.0\lib\net461\System.Security.AccessControl.dll</HintPath>
74+
</Reference>
75+
<Reference Include="System.Security.Principal.Windows, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
76+
<HintPath>..\packages\System.Security.Principal.Windows.4.5.0\lib\net461\System.Security.Principal.Windows.dll</HintPath>
77+
</Reference>
5278
<Reference Include="System.Windows.Forms" />
5379
<Reference Include="Telerik.NetworkConnections, Version=0.2.0.0, Culture=neutral, PublicKeyToken=67cb91587178ac5a, processorArchitecture=MSIL">
5480
<HintPath>..\packages\Telerik.NetworkConnections.0.2.0\lib\net40\Telerik.NetworkConnections.dll</HintPath>
@@ -63,9 +89,19 @@
6389
<None Include="packages.config" />
6490
</ItemGroup>
6591
<ItemGroup>
66-
<None Include="BasicFormatsForCore.dll">
67-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
68-
</None>
92+
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
93+
<Visible>False</Visible>
94+
<ProductName>Microsoft .NET Framework 4.8 %28x86 and x64%29</ProductName>
95+
<Install>true</Install>
96+
</BootstrapperPackage>
97+
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
98+
<Visible>False</Visible>
99+
<ProductName>.NET Framework 3.5 SP1</ProductName>
100+
<Install>false</Install>
101+
</BootstrapperPackage>
102+
</ItemGroup>
103+
<ItemGroup>
104+
<Content Include="BasicFormatsForCore.dll" />
69105
</ItemGroup>
70106
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
71107
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">

CaptureTraffic/NetFramework/CaptureTraffic/Program.cs

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,24 @@ private static void AttachEventListeners()
6363
// be enabled; this allows FiddlerCore to permit modification of
6464
// the response in the BeforeResponse handler rather than streaming
6565
// the response to the client as the response comes in.
66-
session.bBufferResponse = false;
66+
session.bBufferResponse = true;
6767

6868
// Set this property if you want FiddlerCore to automatically authenticate by
6969
// answering Digest/Negotiate/NTLM/Kerberos challenges itself
7070
// session["X-AutoAuth"] = "(default)";
7171

72+
// using X-PROCESSINFO to detect sessions by specific processes
73+
if (session["X-PROCESSINFO"].Contains("brave")) {
74+
Console.WriteLine(">>>>>>>>>>>>>>>> ProcessInfo:" + session["X-PROCESSINFO"]);
75+
}
76+
77+
// using x-no-decrypt to skip decryption for specific sessions
78+
if (session.HTTPMethodIs("CONNECT") && session["X-PROCESSINFO"].Contains("brave"))
79+
{
80+
Console.WriteLine(">>>>>>>>>>>>>>>> ProcessInfo:" + session["X-PROCESSINFO"]);
81+
session["x-no-decrypt"] = "boring process";
82+
}
83+
7284
try
7385
{
7486
sessionsLock.EnterWriteLock();
@@ -101,17 +113,27 @@ private static void AttachEventListeners()
101113
}
102114
*/
103115

104-
/*
105-
Fiddler.FiddlerApplication.BeforeResponse += session => {
106-
// Console.WriteLine($"{session.id}:HTTP {session.responseCode} for {session.fullUrl}");
116+
117+
FiddlerApplication.BeforeResponse += session =>
118+
{
119+
120+
if (session.uriContains("example.com"))
121+
{
122+
Console.WriteLine($"{session.id}:HTTP {session.responseCode} for {session.fullUrl}");
123+
124+
// using utilDecodeResponse and utilReplaceInResponse to modify a response
125+
session.utilDecodeResponse();
126+
session.utilReplaceInResponse("<h1>", "<h3><i>");
127+
session.utilReplaceInResponse("</h1>", "</i></h3>");
128+
}
107129

108130
// Uncomment the following two statements to decompress/unchunk the
109131
// HTTP response and subsequently modify any HTTP responses to replace
110132
// instances of the word "Telerik" with "Progress". You MUST also
111133
// set session.bBufferResponse = true inside the BeforeRequest event handler above.
112134
//
113135
//session.utilDecodeResponse(); session.utilReplaceInResponse("Telerik", "Progress");
114-
};*/
136+
};
115137

116138
FiddlerApplication.AfterSessionComplete += session =>
117139
{
@@ -180,6 +202,9 @@ private static void StartupFiddlerCore()
180202
.OptimizeThreadPool()
181203
.Build();
182204

205+
206+
CONFIG.DecryptWhichProcesses = ProcessFilterCategories.Browsers;
207+
183208
FiddlerApplication.Startup(startupSettings);
184209

185210
FiddlerApplication.Log.LogString($"Created endpoint listening on port {CONFIG.ListenPort}");
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<startup>
4-
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
55
</startup>
66
</configuration>
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="BCMakeCert" version="2.0.9" targetFramework="net40" />
4-
<package id="DotNetZip" version="1.13.4" targetFramework="net40" />
5-
<package id="FiddlerCore" version="5.0.1" targetFramework="net40" />
6-
<package id="Telerik.NetworkConnections" version="0.2.0" targetFramework="net40" />
3+
<package id="BCMakeCert" version="2.0.9" targetFramework="net48" />
4+
<package id="DotNetZip" version="1.13.4" targetFramework="net48" />
5+
<package id="FiddlerCore" version="5.0.2" targetFramework="net48" />
6+
<package id="Telerik.NetworkConnections" version="0.2.0" targetFramework="net48" />
77
</packages>

CaptureTraffic/NetStandard/CaptureTraffic/CaptureTraffic.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="FiddlerCore" Version="5.0.1" />
9+
<PackageReference Include="FiddlerCore" Version="5.0.2" />
1010
</ItemGroup>
1111

1212
</Project>

CaptureTraffic/NuGet.Config

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)