1

I have used Titanium-Web-Proxy for reverse proxy. where i can specify server back-end Ip Address?. I have added end point and also the service started with endpoint. But it could not connect with backend IP Address. Titanium-Web-Proxy

public void StartProxy()
        {
            proxyServer.BeforeRequest += OnRequest;
            proxyServer.BeforeResponse += OnResponse;
            proxyServer.ServerCertificateValidationCallback += OnCertificateValidation;
            proxyServer.ClientCertificateSelectionCallback += OnCertificateSelection;


            var transparentEndPoint = new TransparentProxyEndPoint(IPAddress.Parse("x.x.x.x"), 5001, true)
            {
                GenericCertificateName = "test"

            };

            proxyServer.UpStreamHttpProxy = new ExternalProxy() { HostName = "x.x.x.x", Port = 5000};
            proxyServer.AddEndPoint(transparentEndPoint);
            proxyServer.Start();



        }

please any one help me to add backend IP and provide a samples to authenticate backend IP.

Thanks,
Selva

Jim W
  • 4,866
  • 1
  • 27
  • 43
selva
  • 887
  • 2
  • 7
  • 11
  • Are you sending HTTP traffic? There seem to be bugs in the current version with HTTP. Also I believe you should use your BeforeRequest handler to change the URI to the backend IP that you want to send the request to. I'm figuring this out as I go, so I could be wrong. – Jim W Oct 06 '16 at 20:44

1 Answers1

1

In addition to my comments about the current version (2016/10/06) which they call 1.0.1 in the assembly properties. I believe the intended way to change requests to a backend server is through the BeforeRequest event handler, eg.

    public async Task OnRequest(object sender, SessionEventArgs e)
    {

        string newhost = "http://localhost";
        Uri u = e.WebSession.Request.RequestUri;
        e.WebSession.Request.RequestUri = new Uri(newhost + u.AbsolutePath);

    }
Jim W
  • 4,866
  • 1
  • 27
  • 43