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
b45793dc
Commit
b45793dc
authored
Apr 14, 2018
by
justcoding121
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sort method signature
parent
86a1db20
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
18 deletions
+18
-18
ExplicitClientHandler.cs
Titanium.Web.Proxy/ExplicitClientHandler.cs
+1
-1
Tcp.cs
Titanium.Web.Proxy/Helpers/Tcp.cs
+15
-15
RequestHandler.cs
Titanium.Web.Proxy/RequestHandler.cs
+1
-1
TransparentClientHandler.cs
Titanium.Web.Proxy/TransparentClientHandler.cs
+1
-1
No files found.
Titanium.Web.Proxy/ExplicitClientHandler.cs
View file @
b45793dc
...
...
@@ -211,7 +211,7 @@ namespace Titanium.Web.Proxy
await
TcpHelper
.
SendRaw
(
clientStream
,
connection
.
Stream
,
BufferSize
,
(
buffer
,
offset
,
count
)
=>
{
connectArgs
.
OnDataSent
(
buffer
,
offset
,
count
);
},
(
buffer
,
offset
,
count
)
=>
{
connectArgs
.
OnDataReceived
(
buffer
,
offset
,
count
);
},
ExceptionFunc
,
connectArgs
.
cancellationTokenSource
);
connectArgs
.
cancellationTokenSource
,
ExceptionFunc
);
}
return
;
...
...
Titanium.Web.Proxy/Helpers/Tcp.cs
View file @
b45793dc
...
...
@@ -126,12 +126,12 @@ namespace Titanium.Web.Proxy.Helpers
/// <param name="bufferSize"></param>
/// <param name="onDataSend"></param>
/// <param name="onDataReceive"></param>
/// <param name="exceptionFunc"></param>
/// <param name="cancellationTokenSource"></param>
/// <param name="exceptionFunc"></param>
/// <returns></returns>
internal
static
async
Task
SendRawApm
(
Stream
clientStream
,
Stream
serverStream
,
int
bufferSize
,
Action
<
byte
[],
int
,
int
>
onDataSend
,
Action
<
byte
[],
int
,
int
>
onDataReceive
,
ExceptionHandler
exceptionFunc
,
CancellationTokenSource
cancellationTokenSource
)
Action
<
byte
[],
int
,
int
>
onDataSend
,
Action
<
byte
[],
int
,
int
>
onDataReceive
,
CancellationTokenSource
cancellationTokenSource
,
ExceptionHandler
exceptionFunc
)
{
var
taskCompletionSource
=
new
TaskCompletionSource
<
bool
>();
cancellationTokenSource
.
Token
.
Register
(()
=>
taskCompletionSource
.
TrySetResult
(
true
));
...
...
@@ -141,8 +141,8 @@ namespace Titanium.Web.Proxy.Helpers
var
serverBuffer
=
BufferPool
.
GetBuffer
(
bufferSize
);
try
{
BeginRead
(
clientStream
,
serverStream
,
clientBuffer
,
cancellationTokenSource
,
onDataSend
,
exceptionFunc
);
BeginRead
(
serverStream
,
clientStream
,
serverBuffer
,
cancellationTokenSource
,
onDataReceiv
e
,
BeginRead
(
clientStream
,
serverStream
,
clientBuffer
,
onDataSend
,
cancellationTokenSource
,
exceptionFunc
);
BeginRead
(
serverStream
,
clientStream
,
serverBuffer
,
onDataReceive
,
cancellationTokenSourc
e
,
exceptionFunc
);
await
taskCompletionSource
.
Task
;
}
...
...
@@ -154,7 +154,7 @@ namespace Titanium.Web.Proxy.Helpers
}
private
static
void
BeginRead
(
Stream
inputStream
,
Stream
outputStream
,
byte
[]
buffer
,
CancellationTokenSource
cancellationTokenSource
,
Action
<
byte
[],
int
,
int
>
onCopy
,
Action
<
byte
[],
int
,
int
>
onCopy
,
CancellationTokenSource
cancellationTokenSource
,
ExceptionHandler
exceptionFunc
)
{
if
(
cancellationTokenSource
.
IsCancellationRequested
)
...
...
@@ -193,7 +193,7 @@ namespace Titanium.Web.Proxy.Helpers
try
{
outputStream
.
EndWrite
(
ar2
);
BeginRead
(
inputStream
,
outputStream
,
buffer
,
cancellationTokenSource
,
onCopy
,
BeginRead
(
inputStream
,
outputStream
,
buffer
,
onCopy
,
cancellationTokenSource
,
exceptionFunc
);
}
catch
(
IOException
ex
)
...
...
@@ -230,12 +230,12 @@ namespace Titanium.Web.Proxy.Helpers
/// <param name="bufferSize"></param>
/// <param name="onDataSend"></param>
/// <param name="onDataReceive"></param>
/// <param name="exceptionFunc"></param>
/// <param name="cancellationTokenSource"></param>
/// <param name="exceptionFunc"></param>
/// <returns></returns>
private
static
async
Task
SendRawTap
(
Stream
clientStream
,
Stream
serverStream
,
int
bufferSize
,
Action
<
byte
[],
int
,
int
>
onDataSend
,
Action
<
byte
[],
int
,
int
>
onDataReceive
,
ExceptionHandler
exceptionFunc
,
CancellationTokenSource
cancellationTokenSource
)
Action
<
byte
[],
int
,
int
>
onDataSend
,
Action
<
byte
[],
int
,
int
>
onDataReceive
,
CancellationTokenSource
cancellationTokenSource
,
ExceptionHandler
exceptionFunc
)
{
//Now async relay all server=>client & client=>server data
var
sendRelay
=
...
...
@@ -259,16 +259,16 @@ namespace Titanium.Web.Proxy.Helpers
/// <param name="bufferSize"></param>
/// <param name="onDataSend"></param>
/// <param name="onDataReceive"></param>
/// <param name="exceptionFunc"></param>
/// <param name="cancellationTokenSource"></param>
/// <param name="exceptionFunc"></param>
/// <returns></returns>
internal
static
Task
SendRaw
(
Stream
clientStream
,
Stream
serverStream
,
int
bufferSize
,
Action
<
byte
[],
int
,
int
>
onDataSend
,
Action
<
byte
[],
int
,
int
>
onDataReceive
,
ExceptionHandler
exceptionFunc
,
CancellationTokenSource
cancellationTokenSource
)
Action
<
byte
[],
int
,
int
>
onDataSend
,
Action
<
byte
[],
int
,
int
>
onDataReceive
,
CancellationTokenSource
cancellationTokenSource
,
ExceptionHandler
exceptionFunc
)
{
// todo: fix APM mode
return
SendRawTap
(
clientStream
,
serverStream
,
bufferSize
,
onDataSend
,
onDataReceive
,
exceptionFunc
,
cancellationTokenSource
);
return
SendRawTap
(
clientStream
,
serverStream
,
bufferSize
,
onDataSend
,
onDataReceive
,
cancellationTokenSource
,
exceptionFunc
);
}
}
}
Titanium.Web.Proxy/RequestHandler.cs
View file @
b45793dc
...
...
@@ -230,7 +230,7 @@ namespace Titanium.Web.Proxy
await
TcpHelper
.
SendRaw
(
clientStream
,
connection
.
Stream
,
BufferSize
,
(
buffer
,
offset
,
count
)
=>
{
args
.
OnDataSent
(
buffer
,
offset
,
count
);
},
(
buffer
,
offset
,
count
)
=>
{
args
.
OnDataReceived
(
buffer
,
offset
,
count
);
},
ExceptionFunc
,
args
.
cancellationTokenSource
);
args
.
cancellationTokenSource
,
ExceptionFunc
);
return
;
}
...
...
Titanium.Web.Proxy/TransparentClientHandler.cs
View file @
b45793dc
...
...
@@ -115,7 +115,7 @@ namespace Titanium.Web.Proxy
//var serverHelloInfo = await SslTools.PeekServerHello(serverStream);
await
TcpHelper
.
SendRaw
(
clientStream
,
serverStream
,
BufferSize
,
null
,
null
,
ExceptionFunc
,
args
.
TaskCancellationSource
);
null
,
null
,
args
.
TaskCancellationSource
,
ExceptionFunc
);
}
}
}
...
...
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