Support » Plugin: Stats » Stats doesn't work via a proxy

  • Resolved Gwyneth Llewelyn



    When activating Stats behind a proxy (mandatory by some web hosting services), this doesn’t work, because the included XML-RPC class, class-IXR, isn’t written to directly support proxies.

    You can tweak class-IXR.php according to this post:

    The trick is:

    Look for function query().

    Change (on line 640 or so) to

    $request = “POST http://{$this->server}{$this->path} HTTP/1.0$r”;

    (i.e. the http://{$this->server} is added to the line)

    A bit below that, comment out the @fsockopen calls and use the values as described. This was copied out from Mark Cunningham’s configuration, which has a proxy server at — adjust for your own settings.

    if ($this->timeout) {
    //$fp = @fsockopen($this->server, $this->port, $errno, $errstr, $this->timeout);
    $fp = @fsockopen(‘’, 3128, $errno, $errstr, $this->timeout);
    } else {
    //$fp = @fsockopen($this->server, $this->port, $errno, $errstr);
    $fp = @fsockopen(‘’, 3128, $errno, $errstr);

    This definitely worked for me!

  • The topic ‘ Stats doesn't work via a proxy’ is closed to new replies.