Skip to content

Instantly share code, notes, and snippets.

@SAW4
Last active July 27, 2017 15:31
Show Gist options
  • Save SAW4/b9b284825883c7e34a6473b67f8c5b3b to your computer and use it in GitHub Desktop.
Save SAW4/b9b284825883c7e34a6473b67f8c5b3b to your computer and use it in GitHub Desktop.
Aria2c WebUI tips, work around with DirectURL setting.

Aria2c WebUI - How to make DirectURL permanent

As mention by author, DircetURL's setting should be set in the file configuration.js
But after many times I tried, its not worked as expected.
So, just have a look to the code ... to see what's happening during WebUI initialization?
Finally I found a temporary solution. In the file js/services/rpc/rpc.js :

...
...
  if (['http', 'https'].indexOf(uri.protocol()) != -1 && uri.host() != 'localhost') {
    configurations.push({
      host: uri.host(),
      path: '/jsonrpc',
      port: 6800,
      encrypt: false,
      directURL: 'http://core:81/data_drive/'     // To add this line, as your directURL
    },
    {
      host: uri.host(),
      port: uri.port(),
      path: '/jsonrpc',
      encrypt: ( uri.protocol() == 'https' )
    },
    {
      host: uri.host(),
      port: uri.port(),
      path: authconf.path,
      encrypt: ( uri.protocol() == 'https' )
    });
  }
...
...

The reason causing this problem... I guess it is because this file just override the setting inside configuration.js
... as we know html load script from up to down

...
<script src="configuration.js></script>
...
...
<script src="js/services/rpc/rpc.js></script>

Or, someone just forget to handle DirectURL in that code segment ?


Update: configuration.js actually works

You need to clean the cookies of WebUI in your web browser (make sure ariaconf is not existed) if you have already loaded a config.
Setting changes in WebUI will store to cookies, but not configuration.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment