in reply to Re: Http connection manipulations
in thread Http connection manipulations

1. custom proxy = perl HTTP::Proxy

2. Squid used for roundrobin traffic between 10 external proxy servers.

3. System:

clients<->HTTP::Proxy<->SQUID<-ROUND_ROBIN->External Proxy servers (Parent-proxies 1...10)

.

Problem resides here clients<->HTTP::Proxy

If one of external parent proxy is dead, repeat request through another external parent proxy. Some clients can't follow redirects, so the solution as (far as I can say, but it's may be wrong) is to return content with LWPUserAgent for example, and write it to the "appropriate" connection (from a client to a custom proxy, it can be identified by port, while it's open). I have a working code it's working for redirection, but since not all clients can follow it I have no choice but try to do this thing.

Replies are listed 'Best First'.
Re^3: Http connection manipulations
by flexvault (Monsignor) on Jan 11, 2012 at 14:12 UTC

    1. custom proxy = perl HTTP::Proxy . . . clients<->HTTP::Proxy<->SQUID<-ROUND_ROBIN->External Proxy servers (Pa +rent-proxies 1...10) Problem resides here clients<->HTTP::Proxy

    If I understand your problem (maybe), how do you know which server "SQUID" selects? Second, you now become the single point of failure in your network. Third, Squid is a caching proxy, so if configured correctly, shouldn't it being redirecting to a running server?

    I have never used/configured Squid, but maybe the correct solution is in reconfiguring Squid?

    Good Luck.

    "Well done is better than well said." - Benjamin Franklin

      Unfortunately squid is unable solve this, but he's doing his part with roundrobin. My task now is to implement sockets manipulation or to find a new way to make clients to follow redirects.

        kazak,

        Sorry if I can't follow what you're trying to do, but I would like to help you. Maybe answers to a few questions would help all of us understand your problem:

        • Are you on the same server as squid?
        • Are you setting up a socket connection with the client, and then relaying that to the squid server via a separate connection? or
        • Do you have an API to squid that you can query/respond? or
        • Are you being called by squid as part of some error recover process?

        My problem of understanding your problem is that you seem to between the client and squid, so why can't you ask squid for the redirect and return the response to the client! Or does the response need to go to an entirely different squid structure?

        Sometimes, explaining the problem to others in more detail, will lead you to a better solution, and that's what PM is all about!

        Keep explaining!

        "Well done is better than well said." - Benjamin Franklin