Commit 5a121ccd authored by Jehonathan Thomas's avatar Jehonathan Thomas Committed by GitHub

Merge pull request #305 from justcoding121/develop

Beta 
parents 4186c54c 31da204b
...@@ -37,6 +37,11 @@ For stable releases on [stable branch](https://github.com/justcoding121/Titanium ...@@ -37,6 +37,11 @@ For stable releases on [stable branch](https://github.com/justcoding121/Titanium
Install-Package Titanium.Web.Proxy Install-Package Titanium.Web.Proxy
Supports
* .Net Standard 1.6 or above
* .Net Framework 4.5 or above
Setup HTTP proxy: Setup HTTP proxy:
```csharp ```csharp
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
using System.IO; using System.IO;
using System.IO.Compression; using System.IO.Compression;
using System.Threading.Tasks; using System.Threading.Tasks;
using Titanium.Web.Proxy.Helpers;
namespace Titanium.Web.Proxy.Decompression namespace Titanium.Web.Proxy.Decompression
{ {
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
using System.IO; using System.IO;
using System.IO.Compression; using System.IO.Compression;
using System.Threading.Tasks; using System.Threading.Tasks;
using Titanium.Web.Proxy.Helpers;
namespace Titanium.Web.Proxy.Decompression namespace Titanium.Web.Proxy.Decompression
{ {
......
...@@ -3,7 +3,6 @@ using System; ...@@ -3,7 +3,6 @@ using System;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
using Titanium.Web.Proxy.Helpers;
namespace Titanium.Web.Proxy.Extensions namespace Titanium.Web.Proxy.Extensions
{ {
......
using StreamExtended.Network; using StreamExtended.Network;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Titanium.Web.Proxy.Helpers;
using Titanium.Web.Proxy.Models; using Titanium.Web.Proxy.Models;
using Titanium.Web.Proxy.Shared; using Titanium.Web.Proxy.Shared;
......
...@@ -79,10 +79,20 @@ namespace Titanium.Web.Proxy.Http ...@@ -79,10 +79,20 @@ namespace Titanium.Web.Proxy.Http
using (var ms = new MemoryStream()) using (var ms = new MemoryStream())
using (var writer = new HttpRequestWriter(ms)) using (var writer = new HttpRequestWriter(ms))
{ {
var upstreamProxy = ServerConnection.UpStreamHttpProxy;
bool useUpstreamProxy = upstreamProxy != null && ServerConnection.IsHttps == false;
//prepare the request & headers //prepare the request & headers
writer.WriteLine($"{Request.Method} {Request.RequestUri.PathAndQuery} HTTP/{Request.HttpVersion.Major}.{Request.HttpVersion.Minor}"); if (useUpstreamProxy)
{
writer.WriteLine($"{Request.Method} {Request.OriginalRequestUrl} HTTP/{Request.HttpVersion.Major}.{Request.HttpVersion.Minor}");
}
else
{
writer.WriteLine($"{Request.Method} {Request.RequestUri.PathAndQuery} HTTP/{Request.HttpVersion.Major}.{Request.HttpVersion.Minor}");
}
var upstreamProxy = ServerConnection.UpStreamHttpProxy;
//Send Authentication to Upstream proxy if needed //Send Authentication to Upstream proxy if needed
if (upstreamProxy != null if (upstreamProxy != null
......
using StreamExtended.Network; using StreamExtended.Network;
using System; using System;
using System.IO;
using System.Linq; using System.Linq;
using System.Net.Security; using System.Net.Security;
using System.Net.Sockets; using System.Net.Sockets;
......
...@@ -14,13 +14,12 @@ ...@@ -14,13 +14,12 @@
<copyright>Copyright &#x00A9; Titanium. All rights reserved.</copyright> <copyright>Copyright &#x00A9; Titanium. All rights reserved.</copyright>
<tags></tags> <tags></tags>
<dependencies> <dependencies>
<group>
<dependency id="StreamExtended" version="1.0.18" />
</group>
<group targetFramework="net45"> <group targetFramework="net45">
<dependency id="StreamExtended" version="1.0.18" />
<dependency id="BouncyCastle" version="1.8.1" /> <dependency id="BouncyCastle" version="1.8.1" />
</group> </group>
<group targetFramework="netstandard1.6"> <group targetFramework="netstandard1.6">
<dependency id="StreamExtended" version="1.0.18" />
<dependency id="Portable.BouncyCastle" version="1.8.1.2" /> <dependency id="Portable.BouncyCastle" version="1.8.1.2" />
</group> </group>
</dependencies> </dependencies>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment