ntoporcov / iQbit

GNU General Public License v3.0
563 stars 46 forks source link

iQbit ignores base URL to access qb's API. #17

Open Nexxkinn opened 4 years ago

Nexxkinn commented 4 years ago

I have a setup where every web app is assosiated with base url instead of port.

it works fine with standard webui, but it doesn't in iQbit. Looking at the network request, turns out your script ignores base url, causing wrong url path.

GrandArth commented 4 years ago

May i ask how did you config your qb's default webui so that it assosiated with a url? I tried to do it for /qb but failed, all request was direct to /.

Nexxkinn commented 4 years ago

May i ask how did you config your qb's default webui so that it assosiated with a url? I tried to do it for /qb but failed, all request was direct to /.

I'm using a reverse proxy to achieve that.

Since It's just a single-page web app and the web app doesn't have any mechanism to use base_URL, it's way simpler to just proxy the base url into the port.

In this case, I'm using HAProxy since it was simpler to config and readable enough for me.

frontend proxy
    bind *:80
    acl qb path_beg -i /qb
    use_backend qb-be if qb

backend qb-be
    http-request replace-path /qb/(.*) /\1
    server rutorrent-server __private_ip__:__port__
GrandArth commented 4 years ago

Thx, this is a great help.