Commit 55dc0dcf authored by justcoding121's avatar justcoding121 Committed by justcoding121

Make properties readonly

parent 57f2332b
......@@ -37,12 +37,20 @@ namespace Titanium.Web.Proxy.Models
internal HttpWebRequest proxyRequest { get; set; }
internal HttpWebResponse serverResponse { get; set; }
public int ClientPort { get; set; }
public IPAddress ClientIpAddress { get; set; }
internal bool isHttps { get; set; }
internal string requestURL { get; set; }
internal string requestHostname { get; set; }
internal int clientPort { get; set; }
internal IPAddress clientIpAddress { get; set; }
public int ClientPort { get { return this.clientPort; } }
public IPAddress ClientIpAddress { get { return this.clientIpAddress; } }
public bool IsHttps { get { return this.isHttps; } }
public string RequestURL { get { return this.requestURL; } }
public string RequestHostname { get { return this.requestHostname; } }
public bool IsHttps { get; set; }
public string RequestURL { get; set; }
public string RequestHostname { get; set; }
public string RequestMethod { get { return this.proxyRequest.Method; } }
public int RequestContentLength { get { return requestContentLength; } }
......
......@@ -191,7 +191,7 @@ namespace Titanium.Web.Proxy
if (splitBuffer.Length != 3)
{
TcpHelper.SendRaw(httpCmd, httpsHostName, requestLines, args.IsHttps, clientStreamReader.BaseStream);
TcpHelper.SendRaw(httpCmd, httpsHostName, requestLines, args.isHttps, clientStreamReader.BaseStream);
Dispose(client, clientStream, clientStreamReader, clientStreamWriter, args);
......@@ -212,7 +212,7 @@ namespace Titanium.Web.Proxy
if (httpsDecoratedHostName != null)
{
remoteUri = httpsDecoratedHostName + remoteUri;
args.IsHttps = true;
args.isHttps = true;
}
//construct the web request that we are going to issue on behalf of the client.
......@@ -234,7 +234,7 @@ namespace Titanium.Web.Proxy
if ((header[0] == "upgrade") && (header[1] == "websocket"))
{
TcpHelper.SendRaw(httpCmd, httpsHostName, requestLines, args.IsHttps, clientStreamReader.BaseStream);
TcpHelper.SendRaw(httpCmd, httpsHostName, requestLines, args.isHttps, clientStreamReader.BaseStream);
Dispose(client, clientStream, clientStreamReader, clientStreamWriter, args);
......@@ -246,10 +246,10 @@ namespace Titanium.Web.Proxy
args.proxyRequest.AllowAutoRedirect = false;
args.proxyRequest.AutomaticDecompression = DecompressionMethods.None;
args.RequestHostname = args.proxyRequest.RequestUri.Host;
args.RequestURL = args.proxyRequest.RequestUri.OriginalString;
args.ClientPort = ((IPEndPoint)client.Client.RemoteEndPoint).Port;
args.ClientIpAddress = ((IPEndPoint)client.Client.RemoteEndPoint).Address;
args.requestHostname = args.proxyRequest.RequestUri.Host;
args.requestURL = args.proxyRequest.RequestUri.OriginalString;
args.clientPort = ((IPEndPoint)client.Client.RemoteEndPoint).Port;
args.clientIpAddress = ((IPEndPoint)client.Client.RemoteEndPoint).Address;
args.requestHttpVersion = version;
args.requestIsAlive = args.proxyRequest.KeepAlive;
......@@ -270,7 +270,7 @@ namespace Titanium.Web.Proxy
return;
}
args.proxyRequest.ConnectionGroupName = args.RequestHostname;
args.proxyRequest.ConnectionGroupName = args.requestHostname;
args.proxyRequest.AllowWriteStreamBuffering = true;
//If request was modified by user
......
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