Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Titanium-Web-Proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Titanium-Web-Proxy
Commits
64ce8071
Commit
64ce8071
authored
Jun 24, 2017
by
Honfika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gui example project added (Which also makes finding bugs in TWP easier)
parent
1c0447ee
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
1806 additions
and
0 deletions
+1806
-0
App.config
Examples/Titanium.Web.Proxy.Examples.Wpf/App.config
+6
-0
App.xaml
Examples/Titanium.Web.Proxy.Examples.Wpf/App.xaml
+9
-0
App.xaml.cs
Examples/Titanium.Web.Proxy.Examples.Wpf/App.xaml.cs
+17
-0
MainWindow.xaml
Examples/Titanium.Web.Proxy.Examples.Wpf/MainWindow.xaml
+33
-0
MainWindow.xaml.cs
Examples/Titanium.Web.Proxy.Examples.Wpf/MainWindow.xaml.cs
+163
-0
Annotations.cs
...Titanium.Web.Proxy.Examples.Wpf/Properties/Annotations.cs
+1048
-0
AssemblyInfo.cs
...itanium.Web.Proxy.Examples.Wpf/Properties/AssemblyInfo.cs
+55
-0
Resources.Designer.cs
...m.Web.Proxy.Examples.Wpf/Properties/Resources.Designer.cs
+63
-0
Resources.resx
...Titanium.Web.Proxy.Examples.Wpf/Properties/Resources.resx
+117
-0
Settings.Designer.cs
...um.Web.Proxy.Examples.Wpf/Properties/Settings.Designer.cs
+26
-0
Settings.settings
...anium.Web.Proxy.Examples.Wpf/Properties/Settings.settings
+7
-0
SessionListItem.cs
Examples/Titanium.Web.Proxy.Examples.Wpf/SessionListItem.cs
+125
-0
Titanium.Web.Proxy.Examples.Wpf.csproj
...Proxy.Examples.Wpf/Titanium.Web.Proxy.Examples.Wpf.csproj
+129
-0
Titanium.Web.Proxy.sln
Titanium.Web.Proxy.sln
+7
-0
Titanium.Web.Proxy.sln.DotSettings
Titanium.Web.Proxy.sln.DotSettings
+1
-0
No files found.
Examples/Titanium.Web.Proxy.Examples.Wpf/App.config
0 → 100644
View file @
64ce8071
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
configuration
>
<
startup
>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.5"
/>
</
startup
>
</
configuration
>
Examples/Titanium.Web.Proxy.Examples.Wpf/App.xaml
0 → 100644
View file @
64ce8071
<Application x:Class="Titanium.Web.Proxy.Examples.Wpf.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Titanium.Web.Proxy.Examples.Wpf"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>
Examples/Titanium.Web.Proxy.Examples.Wpf/App.xaml.cs
0 → 100644
View file @
64ce8071
using
System
;
using
System.Collections.Generic
;
using
System.Configuration
;
using
System.Data
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
System.Windows
;
namespace
Titanium.Web.Proxy.Examples.Wpf
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public
partial
class
App
:
Application
{
}
}
Examples/Titanium.Web.Proxy.Examples.Wpf/MainWindow.xaml
0 → 100644
View file @
64ce8071
<Window x:Class="Titanium.Web.Proxy.Examples.Wpf.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Titanium.Web.Proxy.Examples.Wpf"
mc:Ignorable="d"
Title="MainWindow" Height="500" Width="1000" WindowState="Maximized"
DataContext="{Binding RelativeSource={RelativeSource Self}}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="500" />
<ColumnDefinition Width="3" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<GridSplitter Grid.Column="1" HorizontalAlignment="Stretch" />
<ListView Grid.Column="0" HorizontalAlignment="Stretch" ItemsSource="{Binding Sessions}" SelectedItem="{Binding SelectedSession}"
KeyDown="ListViewSessions_OnKeyDown">
<ListView.View>
<GridView>
<GridViewColumn Header="Result" DisplayMemberBinding="{Binding StatusCode}" />
<GridViewColumn Header="Protocol" DisplayMemberBinding="{Binding Protocol}" />
<GridViewColumn Header="Host" DisplayMemberBinding="{Binding Host}" />
<GridViewColumn Header="Url" DisplayMemberBinding="{Binding Url}" />
<GridViewColumn Header="BodySize" DisplayMemberBinding="{Binding BodySize}" />
<GridViewColumn Header="Process" DisplayMemberBinding="{Binding Process}" />
<GridViewColumn Header="SentBytes" DisplayMemberBinding="{Binding SentDataCount}" />
<GridViewColumn Header="ReceivedBytes" DisplayMemberBinding="{Binding ReceivedDataCount}" />
</GridView>
</ListView.View>
</ListView>
</Grid>
</Window>
Examples/Titanium.Web.Proxy.Examples.Wpf/MainWindow.xaml.cs
0 → 100644
View file @
64ce8071
using
System
;
using
System.Collections.Generic
;
using
System.Collections.ObjectModel
;
using
System.Linq
;
using
System.Net
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows
;
using
System.Windows.Controls
;
using
System.Windows.Data
;
using
System.Windows.Documents
;
using
System.Windows.Input
;
using
System.Windows.Media
;
using
System.Windows.Media.Imaging
;
using
System.Windows.Navigation
;
using
System.Windows.Shapes
;
using
Titanium.Web.Proxy.EventArguments
;
using
Titanium.Web.Proxy.Helpers
;
using
Titanium.Web.Proxy.Models
;
namespace
Titanium.Web.Proxy.Examples.Wpf
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public
partial
class
MainWindow
:
Window
{
private
readonly
ProxyServer
proxyServer
;
private
int
lastSessionNumber
;
public
ObservableCollection
<
SessionListItem
>
Sessions
{
get
;
}
=
new
ObservableCollection
<
SessionListItem
>();
public
SessionListItem
SelectedSession
{
get
;
set
;
}
private
readonly
Dictionary
<
SessionEventArgs
,
SessionListItem
>
sessionDictionary
=
new
Dictionary
<
SessionEventArgs
,
SessionListItem
>();
public
MainWindow
()
{
proxyServer
=
new
ProxyServer
();
proxyServer
.
TrustRootCertificate
=
true
;
proxyServer
.
ForwardToUpstreamGateway
=
true
;
var
explicitEndPoint
=
new
ExplicitProxyEndPoint
(
IPAddress
.
Any
,
8000
,
true
);
proxyServer
.
AddEndPoint
(
explicitEndPoint
);
proxyServer
.
BeforeRequest
+=
ProxyServer_BeforeRequest
;
proxyServer
.
BeforeResponse
+=
ProxyServer_BeforeResponse
;
proxyServer
.
TunnelConnectRequest
+=
ProxyServer_TunnelConnectRequest
;
proxyServer
.
TunnelConnectResponse
+=
ProxyServer_TunnelConnectResponse
;
proxyServer
.
Start
();
proxyServer
.
SetAsSystemProxy
(
explicitEndPoint
,
ProxyProtocolType
.
AllHttp
);
InitializeComponent
();
}
private
async
Task
ProxyServer_TunnelConnectRequest
(
object
sender
,
TunnelConnectSessionEventArgs
e
)
{
Dispatcher
.
Invoke
(()
=>
{
AddSession
(
e
);
});
}
private
async
Task
ProxyServer_TunnelConnectResponse
(
object
sender
,
SessionEventArgs
e
)
{
Dispatcher
.
Invoke
(()
=>
{
SessionListItem
item
;
if
(
sessionDictionary
.
TryGetValue
(
e
,
out
item
))
{
item
.
Update
();
}
});
}
private
async
Task
ProxyServer_BeforeRequest
(
object
sender
,
SessionEventArgs
e
)
{
Dispatcher
.
Invoke
(()
=>
{
AddSession
(
e
);
});
}
private
async
Task
ProxyServer_BeforeResponse
(
object
sender
,
SessionEventArgs
e
)
{
Dispatcher
.
Invoke
(()
=>
{
SessionListItem
item
;
if
(
sessionDictionary
.
TryGetValue
(
e
,
out
item
))
{
item
.
Update
();
}
});
}
private
void
AddSession
(
SessionEventArgs
e
)
{
var
item
=
CreateSessionListItem
(
e
);
Sessions
.
Add
(
item
);
sessionDictionary
.
Add
(
e
,
item
);
}
private
SessionListItem
CreateSessionListItem
(
SessionEventArgs
e
)
{
lastSessionNumber
++;
var
item
=
new
SessionListItem
{
Number
=
lastSessionNumber
,
SessionArgs
=
e
,
};
if
(
e
is
TunnelConnectSessionEventArgs
)
{
e
.
DataReceived
+=
(
sender
,
args
)
=>
{
var
session
=
(
SessionEventArgs
)
sender
;
SessionListItem
li
;
if
(
sessionDictionary
.
TryGetValue
(
session
,
out
li
))
{
li
.
ReceivedDataCount
+=
args
.
Count
;
}
};
e
.
DataSent
+=
(
sender
,
args
)
=>
{
var
session
=
(
SessionEventArgs
)
sender
;
SessionListItem
li
;
if
(
sessionDictionary
.
TryGetValue
(
session
,
out
li
))
{
li
.
SentDataCount
+=
args
.
Count
;
}
};
}
item
.
Update
();
return
item
;
}
private
void
Session_DataReceived
(
object
sender
,
EventArgs
e
)
{
Dispatcher
.
Invoke
(()
=>
{
var
session
=
(
SessionEventArgs
)
sender
;
SessionListItem
item
;
if
(
sessionDictionary
.
TryGetValue
(
session
,
out
item
))
{
item
.
Update
();
}
});
}
private
void
ListViewSessions_OnKeyDown
(
object
sender
,
KeyEventArgs
e
)
{
var
selectedItems
=
((
ListView
)
sender
).
SelectedItems
;
foreach
(
var
item
in
selectedItems
.
Cast
<
SessionListItem
>().
ToArray
())
{
Sessions
.
Remove
(
item
);
sessionDictionary
.
Remove
(
item
.
SessionArgs
);
}
}
}
}
Examples/Titanium.Web.Proxy.Examples.Wpf/Properties/Annotations.cs
0 → 100644
View file @
64ce8071
This diff is collapsed.
Click to expand it.
Examples/Titanium.Web.Proxy.Examples.Wpf/Properties/AssemblyInfo.cs
0 → 100644
View file @
64ce8071
using
System.Reflection
;
using
System.Resources
;
using
System.Runtime.CompilerServices
;
using
System.Runtime.InteropServices
;
using
System.Windows
;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Demo WPF")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Demo WPF")]
[assembly: AssemblyCopyright("Copyright ©2017 Titanium")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[
assembly
:
ThemeInfo
(
ResourceDictionaryLocation
.
None
,
//where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation
.
SourceAssembly
//where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Examples/Titanium.Web.Proxy.Examples.Wpf/Properties/Resources.Designer.cs
0 → 100644
View file @
64ce8071
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace
Titanium.Web.Proxy.Examples.Wpf.Properties
{
using
System
;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"System.Resources.Tools.StronglyTypedResourceBuilder"
,
"4.0.0.0"
)]
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
()]
[
global
::
System
.
Runtime
.
CompilerServices
.
CompilerGeneratedAttribute
()]
internal
class
Resources
{
private
static
global
::
System
.
Resources
.
ResourceManager
resourceMan
;
private
static
global
::
System
.
Globalization
.
CultureInfo
resourceCulture
;
[
global
::
System
.
Diagnostics
.
CodeAnalysis
.
SuppressMessageAttribute
(
"Microsoft.Performance"
,
"CA1811:AvoidUncalledPrivateCode"
)]
internal
Resources
()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[
global
::
System
.
ComponentModel
.
EditorBrowsableAttribute
(
global
::
System
.
ComponentModel
.
EditorBrowsableState
.
Advanced
)]
internal
static
global
::
System
.
Resources
.
ResourceManager
ResourceManager
{
get
{
if
(
object
.
ReferenceEquals
(
resourceMan
,
null
))
{
global
::
System
.
Resources
.
ResourceManager
temp
=
new
global
::
System
.
Resources
.
ResourceManager
(
"Titanium.Web.Proxy.Examples.Wpf.Properties.Resources"
,
typeof
(
Resources
).
Assembly
);
resourceMan
=
temp
;
}
return
resourceMan
;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[
global
::
System
.
ComponentModel
.
EditorBrowsableAttribute
(
global
::
System
.
ComponentModel
.
EditorBrowsableState
.
Advanced
)]
internal
static
global
::
System
.
Globalization
.
CultureInfo
Culture
{
get
{
return
resourceCulture
;
}
set
{
resourceCulture
=
value
;
}
}
}
}
Examples/Titanium.Web.Proxy.Examples.Wpf/Properties/Resources.resx
0 → 100644
View file @
64ce8071
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema
id=
"root"
xmlns=
""
xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"
xmlns:msdata=
"urn:schemas-microsoft-com:xml-msdata"
>
<xsd:element
name=
"root"
msdata:IsDataSet=
"true"
>
<xsd:complexType>
<xsd:choice
maxOccurs=
"unbounded"
>
<xsd:element
name=
"metadata"
>
<xsd:complexType>
<xsd:sequence>
<xsd:element
name=
"value"
type=
"xsd:string"
minOccurs=
"0"
/>
</xsd:sequence>
<xsd:attribute
name=
"name"
type=
"xsd:string"
/>
<xsd:attribute
name=
"type"
type=
"xsd:string"
/>
<xsd:attribute
name=
"mimetype"
type=
"xsd:string"
/>
</xsd:complexType>
</xsd:element>
<xsd:element
name=
"assembly"
>
<xsd:complexType>
<xsd:attribute
name=
"alias"
type=
"xsd:string"
/>
<xsd:attribute
name=
"name"
type=
"xsd:string"
/>
</xsd:complexType>
</xsd:element>
<xsd:element
name=
"data"
>
<xsd:complexType>
<xsd:sequence>
<xsd:element
name=
"value"
type=
"xsd:string"
minOccurs=
"0"
msdata:Ordinal=
"1"
/>
<xsd:element
name=
"comment"
type=
"xsd:string"
minOccurs=
"0"
msdata:Ordinal=
"2"
/>
</xsd:sequence>
<xsd:attribute
name=
"name"
type=
"xsd:string"
msdata:Ordinal=
"1"
/>
<xsd:attribute
name=
"type"
type=
"xsd:string"
msdata:Ordinal=
"3"
/>
<xsd:attribute
name=
"mimetype"
type=
"xsd:string"
msdata:Ordinal=
"4"
/>
</xsd:complexType>
</xsd:element>
<xsd:element
name=
"resheader"
>
<xsd:complexType>
<xsd:sequence>
<xsd:element
name=
"value"
type=
"xsd:string"
minOccurs=
"0"
msdata:Ordinal=
"1"
/>
</xsd:sequence>
<xsd:attribute
name=
"name"
type=
"xsd:string"
use=
"required"
/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader
name=
"resmimetype"
>
<value>
text/microsoft-resx
</value>
</resheader>
<resheader
name=
"version"
>
<value>
2.0
</value>
</resheader>
<resheader
name=
"reader"
>
<value>
System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
</value>
</resheader>
<resheader
name=
"writer"
>
<value>
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
</value>
</resheader>
</root>
\ No newline at end of file
Examples/Titanium.Web.Proxy.Examples.Wpf/Properties/Settings.Designer.cs
0 → 100644
View file @
64ce8071
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace
Titanium.Web.Proxy.Examples.Wpf.Properties
{
[
global
::
System
.
Runtime
.
CompilerServices
.
CompilerGeneratedAttribute
()]
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator"
,
"15.1.0.0"
)]
internal
sealed
partial
class
Settings
:
global
::
System
.
Configuration
.
ApplicationSettingsBase
{
private
static
Settings
defaultInstance
=
((
Settings
)(
global
::
System
.
Configuration
.
ApplicationSettingsBase
.
Synchronized
(
new
Settings
())));
public
static
Settings
Default
{
get
{
return
defaultInstance
;
}
}
}
}
Examples/Titanium.Web.Proxy.Examples.Wpf/Properties/Settings.settings
0 → 100644
View file @
64ce8071
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile
xmlns=
"uri:settings"
CurrentProfile=
"(Default)"
>
<Profiles>
<Profile
Name=
"(Default)"
/>
</Profiles>
<Settings
/>
</SettingsFile>
\ No newline at end of file
Examples/Titanium.Web.Proxy.Examples.Wpf/SessionListItem.cs
0 → 100644
View file @
64ce8071
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Linq
;
using
System.Runtime.CompilerServices
;
using
System.Text
;
using
System.Threading.Tasks
;
using
Titanium.Web.Proxy.EventArguments
;
using
Titanium.Web.Proxy.Examples.Wpf.Annotations
;
namespace
Titanium.Web.Proxy.Examples.Wpf
{
public
class
SessionListItem
:
INotifyPropertyChanged
{
private
string
statusCode
;
private
string
protocol
;
private
string
host
;
private
string
url
;
private
long
bodySize
;
private
string
process
;
private
long
receivedDataCount
;
private
long
sentDataCount
;
public
int
Number
{
get
;
set
;
}
public
SessionEventArgs
SessionArgs
{
get
;
set
;
}
public
string
StatusCode
{
get
{
return
statusCode
;
}
set
{
SetField
(
ref
statusCode
,
value
);}
}
public
string
Protocol
{
get
{
return
protocol
;
}
set
{
SetField
(
ref
protocol
,
value
);
}
}
public
string
Host
{
get
{
return
host
;
}
set
{
SetField
(
ref
host
,
value
);
}
}
public
string
Url
{
get
{
return
url
;
}
set
{
SetField
(
ref
url
,
value
);
}
}
public
long
BodySize
{
get
{
return
bodySize
;
}
set
{
SetField
(
ref
bodySize
,
value
);
}
}
public
string
Process
{
get
{
return
process
;
}
set
{
SetField
(
ref
process
,
value
);
}
}
public
long
ReceivedDataCount
{
get
{
return
receivedDataCount
;
}
set
{
SetField
(
ref
receivedDataCount
,
value
);
}
}
public
long
SentDataCount
{
get
{
return
sentDataCount
;
}
set
{
SetField
(
ref
sentDataCount
,
value
);
}
}
public
event
PropertyChangedEventHandler
PropertyChanged
;
protected
void
SetField
<
T
>(
ref
T
field
,
T
value
,[
CallerMemberName
]
string
propertyName
=
null
)
{
field
=
value
;
OnPropertyChanged
(
propertyName
);
}
[
NotifyPropertyChangedInvocator
]
protected
virtual
void
OnPropertyChanged
([
CallerMemberName
]
string
propertyName
=
null
)
{
PropertyChanged
?.
Invoke
(
this
,
new
PropertyChangedEventArgs
(
propertyName
));
}
public
void
Update
()
{
var
request
=
SessionArgs
.
WebSession
.
Request
;
var
response
=
SessionArgs
.
WebSession
.
Response
;
StatusCode
=
response
?.
ResponseStatusCode
??
"-"
;
Protocol
=
request
.
RequestUri
.
Scheme
;
if
(
SessionArgs
is
TunnelConnectSessionEventArgs
)
{
Host
=
"Tunnel to"
;
Url
=
request
.
RequestUri
.
Host
+
":"
+
request
.
RequestUri
.
Port
;
}
else
{
Host
=
request
.
RequestUri
.
Host
;
Url
=
request
.
RequestUri
.
AbsolutePath
;
}
BodySize
=
response
?.
ContentLength
??
-
1
;
Process
=
GetProcessDescription
(
SessionArgs
.
WebSession
.
ProcessId
.
Value
);
}
private
string
GetProcessDescription
(
int
processId
)
{
try
{
var
process
=
System
.
Diagnostics
.
Process
.
GetProcessById
(
processId
);
return
process
.
ProcessName
+
":"
+
processId
;
}
catch
(
Exception
)
{
return
string
.
Empty
;
}
}
}
}
Examples/Titanium.Web.Proxy.Examples.Wpf/Titanium.Web.Proxy.Examples.Wpf.csproj
0 → 100644
View file @
64ce8071
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"15.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<Import
Project=
"$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"
Condition=
"Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"
/>
<PropertyGroup>
<Configuration
Condition=
" '$(Configuration)' == '' "
>
Debug
</Configuration>
<Platform
Condition=
" '$(Platform)' == '' "
>
AnyCPU
</Platform>
<ProjectGuid>
{4406CE17-9A39-4F28-8363-6169A4F799C1}
</ProjectGuid>
<OutputType>
WinExe
</OutputType>
<RootNamespace>
Titanium.Web.Proxy.Examples.Wpf
</RootNamespace>
<AssemblyName>
Titanium.Web.Proxy.Examples.Wpf
</AssemblyName>
<TargetFrameworkVersion>
v4.5
</TargetFrameworkVersion>
<FileAlignment>
512
</FileAlignment>
<ProjectTypeGuids>
{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
</ProjectTypeGuids>
<WarningLevel>
4
</WarningLevel>
<AutoGenerateBindingRedirects>
true
</AutoGenerateBindingRedirects>
<TargetFrameworkProfile
/>
<PublishUrl>
publish\
</PublishUrl>
<Install>
true
</Install>
<InstallFrom>
Disk
</InstallFrom>
<UpdateEnabled>
false
</UpdateEnabled>
<UpdateMode>
Foreground
</UpdateMode>
<UpdateInterval>
7
</UpdateInterval>
<UpdateIntervalUnits>
Days
</UpdateIntervalUnits>
<UpdatePeriodically>
false
</UpdatePeriodically>
<UpdateRequired>
false
</UpdateRequired>
<MapFileExtensions>
true
</MapFileExtensions>
<ApplicationRevision>
0
</ApplicationRevision>
<ApplicationVersion>
1.0.0.%2a
</ApplicationVersion>
<IsWebBootstrapper>
false
</IsWebBootstrapper>
<UseApplicationTrust>
false
</UseApplicationTrust>
<BootstrapperEnabled>
true
</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "
>
<PlatformTarget>
AnyCPU
</PlatformTarget>
<DebugSymbols>
true
</DebugSymbols>
<DebugType>
full
</DebugType>
<Optimize>
false
</Optimize>
<OutputPath>
bin\Debug\
</OutputPath>
<DefineConstants>
DEBUG;TRACE
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
<LangVersion>
6
</LangVersion>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "
>
<PlatformTarget>
AnyCPU
</PlatformTarget>
<DebugType>
pdbonly
</DebugType>
<Optimize>
true
</Optimize>
<OutputPath>
bin\Release\
</OutputPath>
<DefineConstants>
TRACE
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Data"
/>
<Reference
Include=
"System.Xml"
/>
<Reference
Include=
"Microsoft.CSharp"
/>
<Reference
Include=
"System.Core"
/>
<Reference
Include=
"System.Xml.Linq"
/>
<Reference
Include=
"System.Data.DataSetExtensions"
/>
<Reference
Include=
"System.Net.Http"
/>
<Reference
Include=
"System.Xaml"
>
<RequiredTargetFramework>
4.0
</RequiredTargetFramework>
</Reference>
<Reference
Include=
"WindowsBase"
/>
<Reference
Include=
"PresentationCore"
/>
<Reference
Include=
"PresentationFramework"
/>
</ItemGroup>
<ItemGroup>
<ApplicationDefinition
Include=
"App.xaml"
>
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
</ApplicationDefinition>
<Compile
Include=
"Properties\Annotations.cs"
/>
<Compile
Include=
"SessionListItem.cs"
/>
<Page
Include=
"MainWindow.xaml"
>
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
</Page>
<Compile
Include=
"App.xaml.cs"
>
<DependentUpon>
App.xaml
</DependentUpon>
<SubType>
Code
</SubType>
</Compile>
<Compile
Include=
"MainWindow.xaml.cs"
>
<DependentUpon>
MainWindow.xaml
</DependentUpon>
<SubType>
Code
</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"Properties\AssemblyInfo.cs"
>
<SubType>
Code
</SubType>
</Compile>
<Compile
Include=
"Properties\Resources.Designer.cs"
>
<AutoGen>
True
</AutoGen>
<DesignTime>
True
</DesignTime>
<DependentUpon>
Resources.resx
</DependentUpon>
</Compile>
<Compile
Include=
"Properties\Settings.Designer.cs"
>
<AutoGen>
True
</AutoGen>
<DependentUpon>
Settings.settings
</DependentUpon>
<DesignTimeSharedInput>
True
</DesignTimeSharedInput>
</Compile>
<EmbeddedResource
Include=
"Properties\Resources.resx"
>
<Generator>
ResXFileCodeGenerator
</Generator>
<LastGenOutput>
Resources.Designer.cs
</LastGenOutput>
</EmbeddedResource>
<None
Include=
"Properties\Settings.settings"
>
<Generator>
SettingsSingleFileGenerator
</Generator>
<LastGenOutput>
Settings.Designer.cs
</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<None
Include=
"App.config"
/>
</ItemGroup>
<ItemGroup>
<ProjectReference
Include=
"..\..\Titanium.Web.Proxy\Titanium.Web.Proxy.csproj"
>
<Project>
{8d73a1be-868c-42d2-9ece-f32cc1a02906}
</Project>
<Name>
Titanium.Web.Proxy
</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage
Include=
"Microsoft.Net.Framework.3.5.SP1"
>
<Visible>
False
</Visible>
<ProductName>
.NET Framework 3.5 SP1
</ProductName>
<Install>
false
</Install>
</BootstrapperPackage>
</ItemGroup>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
/>
</Project>
\ No newline at end of file
Titanium.Web.Proxy.sln
View file @
64ce8071
...
@@ -35,6 +35,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Titanium.Web.Proxy.UnitTest
...
@@ -35,6 +35,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Titanium.Web.Proxy.UnitTest
EndProject
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Titanium.Web.Proxy.IntegrationTests", "Tests\Titanium.Web.Proxy.IntegrationTests\Titanium.Web.Proxy.IntegrationTests.csproj", "{32231301-B0FB-4F9E-98DF-B3E8A88F4C16}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Titanium.Web.Proxy.IntegrationTests", "Tests\Titanium.Web.Proxy.IntegrationTests\Titanium.Web.Proxy.IntegrationTests.csproj", "{32231301-B0FB-4F9E-98DF-B3E8A88F4C16}"
EndProject
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Titanium.Web.Proxy.Examples.Wpf", "Examples\Titanium.Web.Proxy.Examples.Wpf\Titanium.Web.Proxy.Examples.Wpf.csproj", "{4406CE17-9A39-4F28-8363-6169A4F799C1}"
EndProject
Global
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Any CPU = Debug|Any CPU
...
@@ -57,6 +59,10 @@ Global
...
@@ -57,6 +59,10 @@ Global
{32231301-B0FB-4F9E-98DF-B3E8A88F4C16}.Debug|Any CPU.Build.0 = Debug|Any CPU
{32231301-B0FB-4F9E-98DF-B3E8A88F4C16}.Debug|Any CPU.Build.0 = Debug|Any CPU
{32231301-B0FB-4F9E-98DF-B3E8A88F4C16}.Release|Any CPU.ActiveCfg = Release|Any CPU
{32231301-B0FB-4F9E-98DF-B3E8A88F4C16}.Release|Any CPU.ActiveCfg = Release|Any CPU
{32231301-B0FB-4F9E-98DF-B3E8A88F4C16}.Release|Any CPU.Build.0 = Release|Any CPU
{32231301-B0FB-4F9E-98DF-B3E8A88F4C16}.Release|Any CPU.Build.0 = Release|Any CPU
{4406CE17-9A39-4F28-8363-6169A4F799C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4406CE17-9A39-4F28-8363-6169A4F799C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4406CE17-9A39-4F28-8363-6169A4F799C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4406CE17-9A39-4F28-8363-6169A4F799C1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
HideSolutionNode = FALSE
...
@@ -65,6 +71,7 @@ Global
...
@@ -65,6 +71,7 @@ Global
{F3B7E553-1904-4E80-BDC7-212342B5C952} = {B6DBABDC-C985-4872-9C38-B4E5079CBC4B}
{F3B7E553-1904-4E80-BDC7-212342B5C952} = {B6DBABDC-C985-4872-9C38-B4E5079CBC4B}
{B517E3D0-D03B-436F-AB03-34BA0D5321AF} = {BC1E0789-D348-49CF-8B67-5E99D50EDF64}
{B517E3D0-D03B-436F-AB03-34BA0D5321AF} = {BC1E0789-D348-49CF-8B67-5E99D50EDF64}
{32231301-B0FB-4F9E-98DF-B3E8A88F4C16} = {BC1E0789-D348-49CF-8B67-5E99D50EDF64}
{32231301-B0FB-4F9E-98DF-B3E8A88F4C16} = {BC1E0789-D348-49CF-8B67-5E99D50EDF64}
{4406CE17-9A39-4F28-8363-6169A4F799C1} = {B6DBABDC-C985-4872-9C38-B4E5079CBC4B}
EndGlobalSection
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
GlobalSection(ExtensibilityGlobals) = postSolution
EnterpriseLibraryConfigurationToolBinariesPath = .1.505.2\lib\NET35
EnterpriseLibraryConfigurationToolBinariesPath = .1.505.2\lib\NET35
...
...
Titanium.Web.Proxy.sln.DotSettings
View file @
64ce8071
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/CodeAnnotations/NamespacesWithAnnotations/=Titanium_002EWeb_002EProxy_002EExamples_002EWpf_002EAnnotations/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/LINE_FEED_AT_FILE_END/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/LINE_FEED_AT_FILE_END/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SIMPLE_CASE_STATEMENT_STYLE/@EntryValue">LINE_BREAK</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SIMPLE_CASE_STATEMENT_STYLE/@EntryValue">LINE_BREAK</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SIMPLE_EMBEDDED_STATEMENT_STYLE/@EntryValue">LINE_BREAK</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SIMPLE_EMBEDDED_STATEMENT_STYLE/@EntryValue">LINE_BREAK</s:String>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment