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
f2ba6aec
Commit
f2ba6aec
authored
Jun 17, 2016
by
justcoding121
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update readme
parent
36a721b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
README.md
README.md
+16
-16
No files found.
README.md
View file @
f2ba6aec
...
@@ -35,12 +35,12 @@ After installing nuget package mark following files to be copied to app director
...
@@ -35,12 +35,12 @@ After installing nuget package mark following files to be copied to app director
Setup HTTP proxy:
Setup HTTP proxy:
```
csharp
```
csharp
var
P
roxyServer
=
new
ProxyServer
();
var
p
roxyServer
=
new
ProxyServer
();
P
roxyServer
.
BeforeRequest
+=
OnRequest
;
p
roxyServer
.
BeforeRequest
+=
OnRequest
;
P
roxyServer
.
BeforeResponse
+=
OnResponse
;
p
roxyServer
.
BeforeResponse
+=
OnResponse
;
P
roxyServer
.
ServerCertificateValidationCallback
+=
OnCertificateValidation
;
p
roxyServer
.
ServerCertificateValidationCallback
+=
OnCertificateValidation
;
P
roxyServer
.
ClientCertificateSelectionCallback
+=
OnCertificateSelection
;
p
roxyServer
.
ClientCertificateSelectionCallback
+=
OnCertificateSelection
;
//Exclude Https addresses you don't want to proxy
//Exclude Https addresses you don't want to proxy
...
@@ -53,8 +53,8 @@ Setup HTTP proxy:
...
@@ -53,8 +53,8 @@ Setup HTTP proxy:
//An explicit endpoint is where the client knows about the existance of a proxy
//An explicit endpoint is where the client knows about the existance of a proxy
//So client sends request in a proxy friendly manner
//So client sends request in a proxy friendly manner
P
roxyServer
.
AddEndPoint
(
explicitEndPoint
);
p
roxyServer
.
AddEndPoint
(
explicitEndPoint
);
P
roxyServer
.
Start
();
p
roxyServer
.
Start
();
//Transparent endpoint is usefull for reverse proxying (client is not aware of the existance of proxy)
//Transparent endpoint is usefull for reverse proxying (client is not aware of the existance of proxy)
...
@@ -67,26 +67,26 @@ Setup HTTP proxy:
...
@@ -67,26 +67,26 @@ Setup HTTP proxy:
{
{
GenericCertificateName
=
"google.com"
GenericCertificateName
=
"google.com"
};
};
P
roxyServer
.
AddEndPoint
(
transparentEndPoint
);
p
roxyServer
.
AddEndPoint
(
transparentEndPoint
);
//
P
roxyServer.UpStreamHttpProxy = new ExternalProxy() { HostName = "localhost", Port = 8888 };
//
p
roxyServer.UpStreamHttpProxy = new ExternalProxy() { HostName = "localhost", Port = 8888 };
//
P
roxyServer.UpStreamHttpsProxy = new ExternalProxy() { HostName = "localhost", Port = 8888 };
//
p
roxyServer.UpStreamHttpsProxy = new ExternalProxy() { HostName = "localhost", Port = 8888 };
foreach
(
var
endPoint
in
P
roxyServer
.
ProxyEndPoints
)
foreach
(
var
endPoint
in
p
roxyServer
.
ProxyEndPoints
)
Console
.
WriteLine
(
"Listening on '{0}' endpoint at Ip {1} and port: {2} "
,
Console
.
WriteLine
(
"Listening on '{0}' endpoint at Ip {1} and port: {2} "
,
endPoint
.
GetType
().
Name
,
endPoint
.
IpAddress
,
endPoint
.
Port
);
endPoint
.
GetType
().
Name
,
endPoint
.
IpAddress
,
endPoint
.
Port
);
//Only explicit proxies can be set as system proxy!
//Only explicit proxies can be set as system proxy!
P
roxyServer
.
SetAsSystemHttpProxy
(
explicitEndPoint
);
p
roxyServer
.
SetAsSystemHttpProxy
(
explicitEndPoint
);
P
roxyServer
.
SetAsSystemHttpsProxy
(
explicitEndPoint
);
p
roxyServer
.
SetAsSystemHttpsProxy
(
explicitEndPoint
);
//wait here (You can use something else as a wait function, I am using this as a demo)
//wait here (You can use something else as a wait function, I am using this as a demo)
Console
.
Read
();
Console
.
Read
();
//Unsubscribe & Quit
//Unsubscribe & Quit
P
roxyServer
.
BeforeRequest
-=
OnRequest
;
p
roxyServer
.
BeforeRequest
-=
OnRequest
;
P
roxyServer
.
BeforeResponse
-=
OnResponse
;
p
roxyServer
.
BeforeResponse
-=
OnResponse
;
P
roxyServer
.
Stop
();
p
roxyServer
.
Stop
();
```
```
Sample request and response event handlers
Sample request and response event handlers
...
...
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