sahendrickson

Members
  • Posts

    6
  • Joined

  • Last visited

Posts posted by sahendrickson

  1. I have a linux machine running the btsync web interface on http://localhost:8888. I have apache configured to proxy requests from https://myhost/btsync to http://localhost:8888. It works great except that webui.js constantly tries to access http://myhost/gui, which is incorrect. It should be trying to access http://myhost/btsync/gui. I've narrowed the problem down to a function in webui.js, line 468, which reads:

     

    requestToken: function(c, B)
    {
    var a = this;
    $.ajax({
    type: "POST",
    url: guiBase + "token.html?t=" + Date.now(),
    async: false
    }).done(function( f )
    {
    var e = f.match(/>([^<]+)</);
    if(e) {
    a.TOKEN = e[e.length - 1]
    c();
    }
    });
    },
     
    The problem is that the value in "guiBase" is absolute. It's set to "/gui/". It is defined a little earlier in the file at line 431, which reads:
     
    var urlBase = "";
    var guiBase = urlBase + "/gui/";
    var proxyBase = urlBase + "/proxy";
     
    This essentially hard codes btsync to only work when it is running as the root of a host. However, I have other services running on http://myhost/ that I don't want btsync to conflict with.
     
    To fix this, the values of urlBase, guiBase, and proxyBase can all be set relative paths (relative to .../gui/, which is where they are currently referenced from):
     
    // removed urlBase because we are using relative references now
    var guiBase = ""; // now a relative path to /gui from /gui
    var proxyBase = "../proxy"; // now a relative path to /proxy from /gui
     

    With that change, btsync works flawlessly at different url paths. Would you please incorporate that change?

     

    In case you're curious, here's my apache configuration:

     

    <Proxy http://localhost:8888*>

            Require all granted

    </Proxy>

    <Location /btsync>

            ProxyPass http://localhost:8888

            ProxyPassReverse http://localhost:8888

    </Location>

     

    Thank you,

    -- Scott