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
146152ee
Commit
146152ee
authored
Apr 15, 2019
by
Stéphane Graziano
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
git://github.com/justcoding121/Titanium-Web-Proxy
parents
044a8e06
b309fc21
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
27 deletions
+22
-27
Titanium.Web.Proxy.Examples.Wpf.csproj
...Proxy.Examples.Wpf/Titanium.Web.Proxy.Examples.Wpf.csproj
+2
-2
packages.config
examples/Titanium.Web.Proxy.Examples.Wpf/packages.config
+1
-1
ExplicitClientHandler.cs
src/Titanium.Web.Proxy/ExplicitClientHandler.cs
+7
-2
HttpWriter.cs
src/Titanium.Web.Proxy/Helpers/HttpWriter.cs
+3
-13
Titanium.Web.Proxy.csproj
src/Titanium.Web.Proxy/Titanium.Web.Proxy.csproj
+3
-3
Titanium.Web.Proxy.nuspec
src/Titanium.Web.Proxy/Titanium.Web.Proxy.nuspec
+6
-6
No files found.
examples/Titanium.Web.Proxy.Examples.Wpf/Titanium.Web.Proxy.Examples.Wpf.csproj
View file @
146152ee
...
...
@@ -72,8 +72,8 @@
<Prefer32Bit>
true
</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference
Include=
"StreamExtended, Version=1.0.
190
.0, Culture=neutral, PublicKeyToken=bbfa0f1d54f50043, processorArchitecture=MSIL"
>
<HintPath>
..\..\src\packages\StreamExtended.1.0.
190
\lib\net45\StreamExtended.dll
</HintPath>
<Reference
Include=
"StreamExtended, Version=1.0.
201
.0, Culture=neutral, PublicKeyToken=bbfa0f1d54f50043, processorArchitecture=MSIL"
>
<HintPath>
..\..\src\packages\StreamExtended.1.0.
201
\lib\net45\StreamExtended.dll
</HintPath>
</Reference>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Data"
/>
...
...
examples/Titanium.Web.Proxy.Examples.Wpf/packages.config
View file @
146152ee
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
packages
>
<
package
id
=
"StreamExtended"
version
=
"1.0.
190
"
targetFramework
=
"net45"
/>
<
package
id
=
"StreamExtended"
version
=
"1.0.
201
"
targetFramework
=
"net45"
/>
</
packages
>
\ No newline at end of file
src/Titanium.Web.Proxy/ExplicitClientHandler.cs
View file @
146152ee
...
...
@@ -153,9 +153,14 @@ namespace Titanium.Web.Proxy
}
if
(
EnableTcpServerConnectionPrefetch
)
{
IPAddress
[]
ipAddresses
=
null
;
try
{
//make sure the host can be resolved before creating the prefetch task
var
ipAddresses
=
await
Dns
.
GetHostAddressesAsync
(
connectArgs
.
HttpClient
.
Request
.
RequestUri
.
Host
);
ipAddresses
=
await
Dns
.
GetHostAddressesAsync
(
connectArgs
.
HttpClient
.
Request
.
RequestUri
.
Host
);
}
catch
(
SocketException
)
{
}
if
(
ipAddresses
!=
null
&&
ipAddresses
.
Length
>
0
)
{
...
...
src/Titanium.Web.Proxy/Helpers/HttpWriter.cs
View file @
146152ee
...
...
@@ -18,18 +18,13 @@ namespace Titanium.Web.Proxy.Helpers
private
static
readonly
byte
[]
newLine
=
ProxyConstants
.
NewLineBytes
;
private
static
readonly
Encoder
encoder
=
Encoding
.
ASCII
.
GetEncoder
();
private
readonly
char
[]
charBuffer
;
private
static
readonly
Encoding
encoder
=
Encoding
.
ASCII
;
internal
HttpWriter
(
Stream
stream
,
IBufferPool
bufferPool
,
int
bufferSize
)
{
BufferSize
=
bufferSize
;
this
.
stream
=
stream
;
this
.
bufferPool
=
bufferPool
;
// ASCII encoder max byte count is char count + 1
charBuffer
=
new
char
[
BufferSize
-
1
];
}
internal
int
BufferSize
{
get
;
}
...
...
@@ -55,12 +50,10 @@ namespace Titanium.Web.Proxy.Helpers
int
charCount
=
value
.
Length
;
if
(
charCount
<
BufferSize
-
newLineChars
)
{
value
.
CopyTo
(
0
,
charBuffer
,
0
,
charCount
);
var
buffer
=
bufferPool
.
GetBuffer
(
BufferSize
);
try
{
int
idx
=
encoder
.
GetBytes
(
charBuffer
,
0
,
charCount
,
buffer
,
0
,
true
);
int
idx
=
encoder
.
GetBytes
(
value
,
0
,
charCount
,
buffer
,
0
);
if
(
newLineChars
>
0
)
{
Buffer
.
BlockCopy
(
newLine
,
0
,
buffer
,
idx
,
newLineChars
);
...
...
@@ -76,11 +69,8 @@ namespace Titanium.Web.Proxy.Helpers
}
else
{
var
charBuffer
=
new
char
[
charCount
];
value
.
CopyTo
(
0
,
charBuffer
,
0
,
charCount
);
var
buffer
=
new
byte
[
charCount
+
newLineChars
+
1
];
int
idx
=
encoder
.
GetBytes
(
charBuffer
,
0
,
charCount
,
buffer
,
0
,
true
);
int
idx
=
encoder
.
GetBytes
(
value
,
0
,
charCount
,
buffer
,
0
);
if
(
newLineChars
>
0
)
{
Buffer
.
BlockCopy
(
newLine
,
0
,
buffer
,
idx
,
newLineChars
);
...
...
src/Titanium.Web.Proxy/Titanium.Web.Proxy.csproj
View file @
146152ee
...
...
@@ -13,9 +13,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BrotliSharpLib" Version="0.3.
1
" />
<PackageReference Include="Portable.BouncyCastle" Version="1.8.
3.37
" />
<PackageReference Include="StreamExtended" Version="1.0.
190
" />
<PackageReference Include="BrotliSharpLib" Version="0.3.
3
" />
<PackageReference Include="Portable.BouncyCastle" Version="1.8.
5
" />
<PackageReference Include="StreamExtended" Version="1.0.
201
" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
...
...
src/Titanium.Web.Proxy/Titanium.Web.Proxy.nuspec
View file @
146152ee
...
...
@@ -15,14 +15,14 @@
<tags></tags>
<dependencies>
<group
targetFramework=
"net45"
>
<dependency
id=
"StreamExtended"
version=
"1.0.
190
"
/>
<dependency
id=
"Portable.BouncyCastle"
version=
"1.8.
3.37
"
/>
<dependency
id=
"BrotliSharpLib"
version=
"0.3.
1
"
/>
<dependency
id=
"StreamExtended"
version=
"1.0.
201
"
/>
<dependency
id=
"Portable.BouncyCastle"
version=
"1.8.
5
"
/>
<dependency
id=
"BrotliSharpLib"
version=
"0.3.
3
"
/>
</group>
<group
targetFramework=
"netstandard2.0"
>
<dependency
id=
"StreamExtended"
version=
"1.0.
190
"
/>
<dependency
id=
"Portable.BouncyCastle"
version=
"1.8.
3.37
"
/>
<dependency
id=
"BrotliSharpLib"
version=
"0.3.
1
"
/>
<dependency
id=
"StreamExtended"
version=
"1.0.
201
"
/>
<dependency
id=
"Portable.BouncyCastle"
version=
"1.8.
5
"
/>
<dependency
id=
"BrotliSharpLib"
version=
"0.3.
3
"
/>
<dependency
id=
"Microsoft.Win32.Registry"
version=
"4.4.0"
/>
<dependency
id=
"System.Security.Principal.Windows"
version=
"4.4.1"
/>
</group>
...
...
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