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
8580aaac
Commit
8580aaac
authored
Sep 02, 2016
by
ilushka85
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/release'
Conflicts: Titanium.Web.Proxy/ProxyServer.cs
parents
47c487e8
f212d2c6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
5 deletions
+37
-5
SessionEventArgs.cs
Titanium.Web.Proxy/EventArguments/SessionEventArgs.cs
+31
-4
ProxyServer.cs
Titanium.Web.Proxy/ProxyServer.cs
+6
-1
No files found.
Titanium.Web.Proxy/EventArguments/SessionEventArgs.cs
View file @
8580aaac
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.IO
;
using
System.Text
;
using
System.Text
;
using
Titanium.Web.Proxy.Exceptions
;
using
Titanium.Web.Proxy.Exceptions
;
...
@@ -335,7 +336,6 @@ namespace Titanium.Web.Proxy.EventArguments
...
@@ -335,7 +336,6 @@ namespace Titanium.Web.Proxy.EventArguments
return
await
decompressor
.
Decompress
(
responseBodyStream
,
bufferSize
);
return
await
decompressor
.
Decompress
(
responseBodyStream
,
bufferSize
);
}
}
/// <summary>
/// <summary>
/// Before request is made to server
/// Before request is made to server
/// Respond with the specified HTML string to client
/// Respond with the specified HTML string to client
...
@@ -343,6 +343,18 @@ namespace Titanium.Web.Proxy.EventArguments
...
@@ -343,6 +343,18 @@ namespace Titanium.Web.Proxy.EventArguments
/// </summary>
/// </summary>
/// <param name="html"></param>
/// <param name="html"></param>
public
async
Task
Ok
(
string
html
)
public
async
Task
Ok
(
string
html
)
{
await
Ok
(
html
,
null
);
}
/// <summary>
/// Before request is made to server
/// Respond with the specified HTML string to client
/// and ignore the request
/// </summary>
/// <param name="html"></param>
/// <param name="headers"></param>
public
async
Task
Ok
(
string
html
,
Dictionary
<
string
,
HttpHeader
>
headers
)
{
{
if
(
WebSession
.
Request
.
RequestLocked
)
if
(
WebSession
.
Request
.
RequestLocked
)
{
{
...
@@ -356,7 +368,7 @@ namespace Titanium.Web.Proxy.EventArguments
...
@@ -356,7 +368,7 @@ namespace Titanium.Web.Proxy.EventArguments
var
result
=
Encoding
.
Default
.
GetBytes
(
html
);
var
result
=
Encoding
.
Default
.
GetBytes
(
html
);
await
Ok
(
result
);
await
Ok
(
result
,
headers
);
}
}
/// <summary>
/// <summary>
...
@@ -364,11 +376,26 @@ namespace Titanium.Web.Proxy.EventArguments
...
@@ -364,11 +376,26 @@ namespace Titanium.Web.Proxy.EventArguments
/// Respond with the specified byte[] to client
/// Respond with the specified byte[] to client
/// and ignore the request
/// and ignore the request
/// </summary>
/// </summary>
/// <param name="
body
"></param>
/// <param name="
result
"></param>
public
async
Task
Ok
(
byte
[]
result
)
public
async
Task
Ok
(
byte
[]
result
)
{
{
var
response
=
new
OkResponse
();
await
Ok
(
result
,
null
);
}
/// <summary>
/// Before request is made to server
/// Respond with the specified byte[] to client
/// and ignore the request
/// </summary>
/// <param name="result"></param>
/// <param name="headers"></param>
public
async
Task
Ok
(
byte
[]
result
,
Dictionary
<
string
,
HttpHeader
>
headers
)
{
var
response
=
new
OkResponse
();
if
(
headers
!=
null
&&
headers
.
Count
>
0
)
{
response
.
ResponseHeaders
=
headers
;
}
response
.
HttpVersion
=
WebSession
.
Request
.
HttpVersion
;
response
.
HttpVersion
=
WebSession
.
Request
.
HttpVersion
;
response
.
ResponseBody
=
result
;
response
.
ResponseBody
=
result
;
...
...
Titanium.Web.Proxy/ProxyServer.cs
View file @
8580aaac
...
@@ -138,8 +138,12 @@ namespace Titanium.Web.Proxy
...
@@ -138,8 +138,12 @@ namespace Titanium.Web.Proxy
/// <summary>
/// <summary>
/// Constructor
/// Constructor
/// </summary>
/// </summary>
public
ProxyServer
()
public
ProxyServer
()
:
this
(
null
,
null
)
{
}
public
ProxyServer
(
string
rootCertificateName
,
string
rootCertificateIssuerName
)
{
{
RootCertificateName
=
rootCertificateName
;
RootCertificateIssuerName
=
rootCertificateIssuerName
;
//default values
//default values
ConnectionTimeOutSeconds
=
120
;
ConnectionTimeOutSeconds
=
120
;
CertificateCacheTimeOutMinutes
=
60
;
CertificateCacheTimeOutMinutes
=
60
;
...
@@ -415,6 +419,7 @@ namespace Titanium.Web.Proxy
...
@@ -415,6 +419,7 @@ namespace Titanium.Web.Proxy
await
HandleClient
(
endPoint
as
ExplicitProxyEndPoint
,
tcpClient
);
await
HandleClient
(
endPoint
as
ExplicitProxyEndPoint
,
tcpClient
);
}
}
}
}
finally
finally
{
{
...
...
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