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
Install-Package Titanium.Web.Proxy
Supports
* .Net Standard 1.6 or above
* .Net Framework 4.5 or above
Setup HTTP proxy:
```csharp
......
......@@ -2,7 +2,6 @@
using System.IO;
using System.IO.Compression;
using System.Threading.Tasks;
using Titanium.Web.Proxy.Helpers;
namespace Titanium.Web.Proxy.Decompression
{
......
......@@ -2,7 +2,6 @@
using System.IO;
using System.IO.Compression;
using System.Threading.Tasks;
using Titanium.Web.Proxy.Helpers;
namespace Titanium.Web.Proxy.Decompression
{
......
......@@ -3,7 +3,6 @@ using System;
using System.Globalization;
using System.IO;
using System.Threading.Tasks;
using Titanium.Web.Proxy.Helpers;
namespace Titanium.Web.Proxy.Extensions
{
......
using StreamExtended.Network;
using System.Collections.Generic;
using System.Threading.Tasks;
using Titanium.Web.Proxy.Helpers;
using Titanium.Web.Proxy.Models;
using Titanium.Web.Proxy.Shared;
......
......@@ -79,10 +79,20 @@ namespace Titanium.Web.Proxy.Http
using (var ms = new MemoryStream())
using (var writer = new HttpRequestWriter(ms))
{
var upstreamProxy = ServerConnection.UpStreamHttpProxy;
bool useUpstreamProxy = upstreamProxy != null && ServerConnection.IsHttps == false;
//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
if (upstreamProxy != null
......
using StreamExtended.Network;
using System;
using System.IO;
using System.Linq;
using System.Net.Security;
using System.Net.Sockets;
......
......@@ -14,13 +14,12 @@
<copyright>Copyright &#x00A9; Titanium. All rights reserved.</copyright>
<tags></tags>
<dependencies>
<group>
<dependency id="StreamExtended" version="1.0.18" />
</group>
<group targetFramework="net45">
<dependency id="StreamExtended" version="1.0.18" />
<dependency id="BouncyCastle" version="1.8.1" />
</group>
<group targetFramework="netstandard1.6">
<dependency id="StreamExtended" version="1.0.18" />
<dependency id="Portable.BouncyCastle" version="1.8.1.2" />
</group>
</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