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
74e8f1d6
Commit
74e8f1d6
authored
Mar 14, 2018
by
Honfika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add SessionEventArgs to ProxyAuthorizationException, own delegate tpye for the exception func.
parent
4b6484ca
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
40 additions
and
27 deletions
+40
-27
CertificateManagerTests.cs
...s/Titanium.Web.Proxy.UnitTests/CertificateManagerTests.cs
+2
-2
SessionEventArgs.cs
Titanium.Web.Proxy/EventArguments/SessionEventArgs.cs
+2
-2
TunnelConnectEventArgs.cs
Titanium.Web.Proxy/EventArguments/TunnelConnectEventArgs.cs
+1
-1
ExceptionHandler.cs
Titanium.Web.Proxy/ExceptionHandler.cs
+6
-0
BodyNotFoundException.cs
Titanium.Web.Proxy/Exceptions/BodyNotFoundException.cs
+1
-1
ProxyAuthorizationException.cs
Titanium.Web.Proxy/Exceptions/ProxyAuthorizationException.cs
+6
-1
ProxyHttpException.cs
Titanium.Web.Proxy/Exceptions/ProxyHttpException.cs
+1
-1
FuncExtensions.cs
Titanium.Web.Proxy/Extensions/FuncExtensions.cs
+2
-2
Tcp.cs
Titanium.Web.Proxy/Helpers/Tcp.cs
+4
-4
ExplicitProxyEndPoint.cs
Titanium.Web.Proxy/Models/ExplicitProxyEndPoint.cs
+2
-2
BCCertificateMaker.cs
Titanium.Web.Proxy/Network/Certificate/BCCertificateMaker.cs
+2
-2
WinCertificateMaker.cs
...nium.Web.Proxy/Network/Certificate/WinCertificateMaker.cs
+2
-2
CertificateManager.cs
Titanium.Web.Proxy/Network/CertificateManager.cs
+5
-3
ProxyAuthorizationHandler.cs
Titanium.Web.Proxy/ProxyAuthorizationHandler.cs
+1
-1
ProxyServer.cs
Titanium.Web.Proxy/ProxyServer.cs
+3
-3
No files found.
Tests/Titanium.Web.Proxy.UnitTests/CertificateManagerTests.cs
View file @
74e8f1d6
...
@@ -19,7 +19,7 @@ namespace Titanium.Web.Proxy.UnitTests
...
@@ -19,7 +19,7 @@ namespace Titanium.Web.Proxy.UnitTests
{
{
var
tasks
=
new
List
<
Task
>();
var
tasks
=
new
List
<
Task
>();
var
mgr
=
new
CertificateManager
(
null
,
null
,
false
,
false
,
false
,
new
Lazy
<
Action
<
Exception
>
>(()
=>
(
e
=>
var
mgr
=
new
CertificateManager
(
null
,
null
,
false
,
false
,
false
,
new
Lazy
<
ExceptionHandler
>(()
=>
(
e
=>
{
{
//Console.WriteLine(e.ToString() + e.InnerException != null ? e.InnerException.ToString() : string.Empty);
//Console.WriteLine(e.ToString() + e.InnerException != null ? e.InnerException.ToString() : string.Empty);
})).
Value
);
})).
Value
);
...
@@ -48,7 +48,7 @@ namespace Titanium.Web.Proxy.UnitTests
...
@@ -48,7 +48,7 @@ namespace Titanium.Web.Proxy.UnitTests
{
{
var
tasks
=
new
List
<
Task
>();
var
tasks
=
new
List
<
Task
>();
var
mgr
=
new
CertificateManager
(
null
,
null
,
false
,
false
,
false
,
new
Lazy
<
Action
<
Exception
>
>(()
=>
(
e
=>
var
mgr
=
new
CertificateManager
(
null
,
null
,
false
,
false
,
false
,
new
Lazy
<
ExceptionHandler
>(()
=>
(
e
=>
{
{
//Console.WriteLine(e.ToString() + e.InnerException != null ? e.InnerException.ToString() : string.Empty);
//Console.WriteLine(e.ToString() + e.InnerException != null ? e.InnerException.ToString() : string.Empty);
})).
Value
);
})).
Value
);
...
...
Titanium.Web.Proxy/EventArguments/SessionEventArgs.cs
View file @
74e8f1d6
...
@@ -29,7 +29,7 @@ namespace Titanium.Web.Proxy.EventArguments
...
@@ -29,7 +29,7 @@ namespace Titanium.Web.Proxy.EventArguments
/// </summary>
/// </summary>
private
readonly
int
bufferSize
;
private
readonly
int
bufferSize
;
private
readonly
Action
<
Exception
>
exceptionFunc
;
private
readonly
ExceptionHandler
exceptionFunc
;
/// <summary>
/// <summary>
/// Backing field for corresponding public property
/// Backing field for corresponding public property
...
@@ -105,7 +105,7 @@ namespace Titanium.Web.Proxy.EventArguments
...
@@ -105,7 +105,7 @@ namespace Titanium.Web.Proxy.EventArguments
/// </summary>
/// </summary>
internal
SessionEventArgs
(
int
bufferSize
,
internal
SessionEventArgs
(
int
bufferSize
,
ProxyEndPoint
endPoint
,
ProxyEndPoint
endPoint
,
Action
<
Exception
>
exceptionFunc
)
ExceptionHandler
exceptionFunc
)
{
{
this
.
bufferSize
=
bufferSize
;
this
.
bufferSize
=
bufferSize
;
this
.
exceptionFunc
=
exceptionFunc
;
this
.
exceptionFunc
=
exceptionFunc
;
...
...
Titanium.Web.Proxy/EventArguments/TunnelConnectEventArgs.cs
View file @
74e8f1d6
...
@@ -10,7 +10,7 @@ namespace Titanium.Web.Proxy.EventArguments
...
@@ -10,7 +10,7 @@ namespace Titanium.Web.Proxy.EventArguments
public
bool
IsHttpsConnect
{
get
;
internal
set
;
}
public
bool
IsHttpsConnect
{
get
;
internal
set
;
}
internal
TunnelConnectSessionEventArgs
(
int
bufferSize
,
ProxyEndPoint
endPoint
,
ConnectRequest
connectRequest
,
Action
<
Exception
>
exceptionFunc
)
internal
TunnelConnectSessionEventArgs
(
int
bufferSize
,
ProxyEndPoint
endPoint
,
ConnectRequest
connectRequest
,
ExceptionHandler
exceptionFunc
)
:
base
(
bufferSize
,
endPoint
,
exceptionFunc
)
:
base
(
bufferSize
,
endPoint
,
exceptionFunc
)
{
{
WebSession
.
Request
=
connectRequest
;
WebSession
.
Request
=
connectRequest
;
...
...
Titanium.Web.Proxy/ExceptionHandler.cs
0 → 100644
View file @
74e8f1d6
using
System
;
namespace
Titanium.Web.Proxy
{
public
delegate
void
ExceptionHandler
(
Exception
exception
);
}
\ No newline at end of file
Titanium.Web.Proxy/Exceptions/BodyNotFoundException.cs
View file @
74e8f1d6
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
/// Constructor.
/// Constructor.
/// </summary>
/// </summary>
/// <param name="message"></param>
/// <param name="message"></param>
public
BodyNotFoundException
(
string
message
)
:
base
(
message
)
internal
BodyNotFoundException
(
string
message
)
:
base
(
message
)
{
{
}
}
}
}
...
...
Titanium.Web.Proxy/Exceptions/ProxyAuthorizationException.cs
View file @
74e8f1d6
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
Titanium.Web.Proxy.EventArguments
;
using
Titanium.Web.Proxy.Models
;
using
Titanium.Web.Proxy.Models
;
namespace
Titanium.Web.Proxy.Exceptions
namespace
Titanium.Web.Proxy.Exceptions
...
@@ -13,13 +14,17 @@ namespace Titanium.Web.Proxy.Exceptions
...
@@ -13,13 +14,17 @@ namespace Titanium.Web.Proxy.Exceptions
/// Instantiate new instance
/// Instantiate new instance
/// </summary>
/// </summary>
/// <param name="message">Exception message</param>
/// <param name="message">Exception message</param>
/// <param name="session">The <see cref="SessionEventArgs"/> instance containing the event data.</param>
/// <param name="innerException">Inner exception associated to upstream proxy authorization</param>
/// <param name="innerException">Inner exception associated to upstream proxy authorization</param>
/// <param name="headers">Http's headers associated</param>
/// <param name="headers">Http's headers associated</param>
public
ProxyAuthorizationException
(
string
message
,
Exception
innerException
,
IEnumerable
<
HttpHeader
>
headers
)
:
base
(
message
,
innerException
)
internal
ProxyAuthorizationException
(
string
message
,
SessionEventArgs
session
,
Exception
innerException
,
IEnumerable
<
HttpHeader
>
headers
)
:
base
(
message
,
innerException
)
{
{
Session
=
session
;
Headers
=
headers
;
Headers
=
headers
;
}
}
public
SessionEventArgs
Session
{
get
;
}
/// <summary>
/// <summary>
/// Headers associated with the authorization exception
/// Headers associated with the authorization exception
/// </summary>
/// </summary>
...
...
Titanium.Web.Proxy/Exceptions/ProxyHttpException.cs
View file @
74e8f1d6
...
@@ -14,7 +14,7 @@ namespace Titanium.Web.Proxy.Exceptions
...
@@ -14,7 +14,7 @@ namespace Titanium.Web.Proxy.Exceptions
/// <param name="message">Message for this exception</param>
/// <param name="message">Message for this exception</param>
/// <param name="innerException">Associated inner exception</param>
/// <param name="innerException">Associated inner exception</param>
/// <param name="sessionEventArgs">Instance of <see cref="EventArguments.SessionEventArgs"/> associated to the exception</param>
/// <param name="sessionEventArgs">Instance of <see cref="EventArguments.SessionEventArgs"/> associated to the exception</param>
public
ProxyHttpException
(
string
message
,
Exception
innerException
,
SessionEventArgs
sessionEventArgs
)
:
base
(
message
,
innerException
)
internal
ProxyHttpException
(
string
message
,
Exception
innerException
,
SessionEventArgs
sessionEventArgs
)
:
base
(
message
,
innerException
)
{
{
SessionEventArgs
=
sessionEventArgs
;
SessionEventArgs
=
sessionEventArgs
;
}
}
...
...
Titanium.Web.Proxy/Extensions/FuncExtensions.cs
View file @
74e8f1d6
...
@@ -7,7 +7,7 @@ namespace Titanium.Web.Proxy.Extensions
...
@@ -7,7 +7,7 @@ namespace Titanium.Web.Proxy.Extensions
internal
static
class
FuncExtensions
internal
static
class
FuncExtensions
{
{
public
static
async
Task
InvokeAsync
<
T
>(
this
AsyncEventHandler
<
T
>
callback
,
object
sender
,
T
args
,
Action
<
Exception
>
exceptionFunc
)
public
static
async
Task
InvokeAsync
<
T
>(
this
AsyncEventHandler
<
T
>
callback
,
object
sender
,
T
args
,
ExceptionHandler
exceptionFunc
)
{
{
var
invocationList
=
callback
.
GetInvocationList
();
var
invocationList
=
callback
.
GetInvocationList
();
...
@@ -17,7 +17,7 @@ namespace Titanium.Web.Proxy.Extensions
...
@@ -17,7 +17,7 @@ namespace Titanium.Web.Proxy.Extensions
}
}
}
}
private
static
async
Task
InternalInvokeAsync
<
T
>(
AsyncEventHandler
<
T
>
callback
,
object
sender
,
T
args
,
Action
<
Exception
>
exceptionFunc
)
private
static
async
Task
InternalInvokeAsync
<
T
>(
AsyncEventHandler
<
T
>
callback
,
object
sender
,
T
args
,
ExceptionHandler
exceptionFunc
)
{
{
try
try
{
{
...
...
Titanium.Web.Proxy/Helpers/Tcp.cs
View file @
74e8f1d6
...
@@ -122,7 +122,7 @@ namespace Titanium.Web.Proxy.Helpers
...
@@ -122,7 +122,7 @@ namespace Titanium.Web.Proxy.Helpers
/// <param name="exceptionFunc"></param>
/// <param name="exceptionFunc"></param>
/// <returns></returns>
/// <returns></returns>
internal
static
async
Task
SendRawApm
(
Stream
clientStream
,
Stream
serverStream
,
int
bufferSize
,
internal
static
async
Task
SendRawApm
(
Stream
clientStream
,
Stream
serverStream
,
int
bufferSize
,
Action
<
byte
[],
int
,
int
>
onDataSend
,
Action
<
byte
[],
int
,
int
>
onDataReceive
,
Action
<
Exception
>
exceptionFunc
)
Action
<
byte
[],
int
,
int
>
onDataSend
,
Action
<
byte
[],
int
,
int
>
onDataReceive
,
ExceptionHandler
exceptionFunc
)
{
{
var
tcs
=
new
TaskCompletionSource
<
bool
>();
var
tcs
=
new
TaskCompletionSource
<
bool
>();
var
cts
=
new
CancellationTokenSource
();
var
cts
=
new
CancellationTokenSource
();
...
@@ -145,7 +145,7 @@ namespace Titanium.Web.Proxy.Helpers
...
@@ -145,7 +145,7 @@ namespace Titanium.Web.Proxy.Helpers
}
}
private
static
void
BeginRead
(
Stream
inputStream
,
Stream
outputStream
,
byte
[]
buffer
,
CancellationTokenSource
cts
,
Action
<
byte
[],
int
,
int
>
onCopy
,
private
static
void
BeginRead
(
Stream
inputStream
,
Stream
outputStream
,
byte
[]
buffer
,
CancellationTokenSource
cts
,
Action
<
byte
[],
int
,
int
>
onCopy
,
Action
<
Exception
>
exceptionFunc
)
ExceptionHandler
exceptionFunc
)
{
{
if
(
cts
.
IsCancellationRequested
)
if
(
cts
.
IsCancellationRequested
)
{
{
...
@@ -221,7 +221,7 @@ namespace Titanium.Web.Proxy.Helpers
...
@@ -221,7 +221,7 @@ namespace Titanium.Web.Proxy.Helpers
/// <param name="exceptionFunc"></param>
/// <param name="exceptionFunc"></param>
/// <returns></returns>
/// <returns></returns>
internal
static
async
Task
SendRawTap
(
Stream
clientStream
,
Stream
serverStream
,
int
bufferSize
,
internal
static
async
Task
SendRawTap
(
Stream
clientStream
,
Stream
serverStream
,
int
bufferSize
,
Action
<
byte
[],
int
,
int
>
onDataSend
,
Action
<
byte
[],
int
,
int
>
onDataReceive
,
Action
<
Exception
>
exceptionFunc
)
Action
<
byte
[],
int
,
int
>
onDataSend
,
Action
<
byte
[],
int
,
int
>
onDataReceive
,
ExceptionHandler
exceptionFunc
)
{
{
var
cts
=
new
CancellationTokenSource
();
var
cts
=
new
CancellationTokenSource
();
...
@@ -247,7 +247,7 @@ namespace Titanium.Web.Proxy.Helpers
...
@@ -247,7 +247,7 @@ namespace Titanium.Web.Proxy.Helpers
/// <param name="exceptionFunc"></param>
/// <param name="exceptionFunc"></param>
/// <returns></returns>
/// <returns></returns>
internal
static
Task
SendRaw
(
Stream
clientStream
,
Stream
serverStream
,
int
bufferSize
,
internal
static
Task
SendRaw
(
Stream
clientStream
,
Stream
serverStream
,
int
bufferSize
,
Action
<
byte
[],
int
,
int
>
onDataSend
,
Action
<
byte
[],
int
,
int
>
onDataReceive
,
Action
<
Exception
>
exceptionFunc
)
Action
<
byte
[],
int
,
int
>
onDataSend
,
Action
<
byte
[],
int
,
int
>
onDataReceive
,
ExceptionHandler
exceptionFunc
)
{
{
#if NET45
#if NET45
return
SendRawApm
(
clientStream
,
serverStream
,
bufferSize
,
onDataSend
,
onDataReceive
,
exceptionFunc
);
return
SendRawApm
(
clientStream
,
serverStream
,
bufferSize
,
onDataSend
,
onDataReceive
,
exceptionFunc
);
...
...
Titanium.Web.Proxy/Models/ExplicitProxyEndPoint.cs
View file @
74e8f1d6
...
@@ -45,7 +45,7 @@ namespace Titanium.Web.Proxy.Models
...
@@ -45,7 +45,7 @@ namespace Titanium.Web.Proxy.Models
{
{
}
}
internal
async
Task
InvokeBeforeTunnelConnectRequest
(
ProxyServer
proxyServer
,
TunnelConnectSessionEventArgs
connectArgs
,
Action
<
Exception
>
exceptionFunc
)
internal
async
Task
InvokeBeforeTunnelConnectRequest
(
ProxyServer
proxyServer
,
TunnelConnectSessionEventArgs
connectArgs
,
ExceptionHandler
exceptionFunc
)
{
{
if
(
BeforeTunnelConnectRequest
!=
null
)
if
(
BeforeTunnelConnectRequest
!=
null
)
{
{
...
@@ -53,7 +53,7 @@ namespace Titanium.Web.Proxy.Models
...
@@ -53,7 +53,7 @@ namespace Titanium.Web.Proxy.Models
}
}
}
}
internal
async
Task
InvokeBeforeTunnectConnectResponse
(
ProxyServer
proxyServer
,
TunnelConnectSessionEventArgs
connectArgs
,
Action
<
Exception
>
exceptionFunc
,
bool
isClientHello
=
false
)
internal
async
Task
InvokeBeforeTunnectConnectResponse
(
ProxyServer
proxyServer
,
TunnelConnectSessionEventArgs
connectArgs
,
ExceptionHandler
exceptionFunc
,
bool
isClientHello
=
false
)
{
{
if
(
BeforeTunnelConnectResponse
!=
null
)
if
(
BeforeTunnelConnectResponse
!=
null
)
{
{
...
...
Titanium.Web.Proxy/Network/Certificate/BCCertificateMaker.cs
View file @
74e8f1d6
...
@@ -33,9 +33,9 @@ namespace Titanium.Web.Proxy.Network.Certificate
...
@@ -33,9 +33,9 @@ namespace Titanium.Web.Proxy.Network.Certificate
// Set this flag to true when exception detected to avoid further exceptions
// Set this flag to true when exception detected to avoid further exceptions
private
static
bool
doNotSetFriendlyName
;
private
static
bool
doNotSetFriendlyName
;
private
readonly
Action
<
Exception
>
exceptionFunc
;
private
readonly
ExceptionHandler
exceptionFunc
;
internal
BCCertificateMaker
(
Action
<
Exception
>
exceptionFunc
)
internal
BCCertificateMaker
(
ExceptionHandler
exceptionFunc
)
{
{
this
.
exceptionFunc
=
exceptionFunc
;
this
.
exceptionFunc
=
exceptionFunc
;
}
}
...
...
Titanium.Web.Proxy/Network/Certificate/WinCertificateMaker.cs
View file @
74e8f1d6
...
@@ -43,12 +43,12 @@ namespace Titanium.Web.Proxy.Network.Certificate
...
@@ -43,12 +43,12 @@ namespace Titanium.Web.Proxy.Network.Certificate
private
object
sharedPrivateKey
;
private
object
sharedPrivateKey
;
private
readonly
Action
<
Exception
>
exceptionFunc
;
private
readonly
ExceptionHandler
exceptionFunc
;
/// <summary>
/// <summary>
/// Constructor.
/// Constructor.
/// </summary>
/// </summary>
internal
WinCertificateMaker
(
Action
<
Exception
>
exceptionFunc
)
internal
WinCertificateMaker
(
ExceptionHandler
exceptionFunc
)
{
{
this
.
exceptionFunc
=
exceptionFunc
;
this
.
exceptionFunc
=
exceptionFunc
;
typeX500DN
=
Type
.
GetTypeFromProgID
(
"X509Enrollment.CX500DistinguishedName"
,
true
);
typeX500DN
=
Type
.
GetTypeFromProgID
(
"X509Enrollment.CX500DistinguishedName"
,
true
);
...
...
Titanium.Web.Proxy/Network/CertificateManager.cs
View file @
74e8f1d6
...
@@ -59,7 +59,7 @@ namespace Titanium.Web.Proxy.Network
...
@@ -59,7 +59,7 @@ namespace Titanium.Web.Proxy.Network
private
readonly
ConcurrentDictionary
<
string
,
CachedCertificate
>
certificateCache
;
private
readonly
ConcurrentDictionary
<
string
,
CachedCertificate
>
certificateCache
;
private
readonly
ConcurrentDictionary
<
string
,
Task
<
X509Certificate2
>>
pendingCertificateCreationTasks
;
private
readonly
ConcurrentDictionary
<
string
,
Task
<
X509Certificate2
>>
pendingCertificateCreationTasks
;
private
readonly
Action
<
Exception
>
exceptionFunc
;
private
readonly
ExceptionHandler
exceptionFunc
;
/// <summary>
/// <summary>
/// Is the root certificate used by this proxy is valid?
/// Is the root certificate used by this proxy is valid?
...
@@ -107,7 +107,9 @@ namespace Titanium.Web.Proxy.Network
...
@@ -107,7 +107,9 @@ namespace Titanium.Web.Proxy.Network
if
(
certEngine
==
null
)
if
(
certEngine
==
null
)
{
{
certEngine
=
engine
==
CertificateEngine
.
BouncyCastle
?
(
ICertificateMaker
)
new
BCCertificateMaker
(
exceptionFunc
)
:
new
WinCertificateMaker
(
exceptionFunc
);
certEngine
=
engine
==
CertificateEngine
.
BouncyCastle
?
(
ICertificateMaker
)
new
BCCertificateMaker
(
exceptionFunc
)
:
new
WinCertificateMaker
(
exceptionFunc
);
}
}
}
}
}
}
...
@@ -198,7 +200,7 @@ namespace Titanium.Web.Proxy.Network
...
@@ -198,7 +200,7 @@ namespace Titanium.Web.Proxy.Network
/// <param name="machineTrustRootCertificate">Note:setting machineTrustRootCertificate to true will force userTrustRootCertificate to true</param>
/// <param name="machineTrustRootCertificate">Note:setting machineTrustRootCertificate to true will force userTrustRootCertificate to true</param>
/// <param name="trustRootCertificateAsAdmin"></param>
/// <param name="trustRootCertificateAsAdmin"></param>
/// <param name="exceptionFunc"></param>
/// <param name="exceptionFunc"></param>
internal
CertificateManager
(
string
rootCertificateName
,
string
rootCertificateIssuerName
,
bool
userTrustRootCertificate
,
bool
machineTrustRootCertificate
,
bool
trustRootCertificateAsAdmin
,
Action
<
Exception
>
exceptionFunc
)
internal
CertificateManager
(
string
rootCertificateName
,
string
rootCertificateIssuerName
,
bool
userTrustRootCertificate
,
bool
machineTrustRootCertificate
,
bool
trustRootCertificateAsAdmin
,
ExceptionHandler
exceptionFunc
)
{
{
this
.
exceptionFunc
=
exceptionFunc
;
this
.
exceptionFunc
=
exceptionFunc
;
...
...
Titanium.Web.Proxy/ProxyAuthorizationHandler.cs
View file @
74e8f1d6
...
@@ -63,7 +63,7 @@ namespace Titanium.Web.Proxy
...
@@ -63,7 +63,7 @@ namespace Titanium.Web.Proxy
}
}
catch
(
Exception
e
)
catch
(
Exception
e
)
{
{
ExceptionFunc
(
new
ProxyAuthorizationException
(
"Error whilst authorizing request"
,
e
,
httpHeaders
));
ExceptionFunc
(
new
ProxyAuthorizationException
(
"Error whilst authorizing request"
,
session
,
e
,
httpHeaders
));
//Return not authorized
//Return not authorized
session
.
WebSession
.
Response
=
CreateAuthentication407Response
(
"Proxy Authentication Invalid"
);
session
.
WebSession
.
Response
=
CreateAuthentication407Response
(
"Proxy Authentication Invalid"
);
...
...
Titanium.Web.Proxy/ProxyServer.cs
View file @
74e8f1d6
...
@@ -53,12 +53,12 @@ namespace Titanium.Web.Proxy
...
@@ -53,12 +53,12 @@ namespace Titanium.Web.Proxy
/// <summary>
/// <summary>
/// An default exception log func
/// An default exception log func
/// </summary>
/// </summary>
private
readonly
Lazy
<
Action
<
Exception
>>
defaultExceptionFunc
=
new
Lazy
<
Action
<
Exception
>
>(()
=>
(
e
=>
{
}));
private
readonly
Lazy
<
ExceptionHandler
>
defaultExceptionFunc
=
new
Lazy
<
ExceptionHandler
>(()
=>
(
e
=>
{
}));
/// <summary>
/// <summary>
/// backing exception func for exposed public property
/// backing exception func for exposed public property
/// </summary>
/// </summary>
private
Action
<
Exception
>
exceptionFunc
;
private
ExceptionHandler
exceptionFunc
;
/// <summary>
/// <summary>
/// Is the proxy currently running
/// Is the proxy currently running
...
@@ -192,7 +192,7 @@ namespace Titanium.Web.Proxy
...
@@ -192,7 +192,7 @@ namespace Titanium.Web.Proxy
/// <summary>
/// <summary>
/// Callback for error events in proxy
/// Callback for error events in proxy
/// </summary>
/// </summary>
public
Action
<
Exception
>
ExceptionFunc
public
ExceptionHandler
ExceptionFunc
{
{
get
=>
exceptionFunc
??
defaultExceptionFunc
.
Value
;
get
=>
exceptionFunc
??
defaultExceptionFunc
.
Value
;
set
=>
exceptionFunc
=
value
;
set
=>
exceptionFunc
=
value
;
...
...
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