EternalC0der / node-aria2

Aria2 RPC client for Node.js
8 stars 1 forks source link

aria2.open() did not validate secret. #7

Open Rewrite0 opened 1 year ago

Rewrite0 commented 1 year ago

aria2 secret: '123'

const aria2 = new Aria2RPC(
      host: 'localhost',
      port: 6800,
      secure: false,
      secret: '',  // No '123'
      path: '/jsonrpc'
);

aria2
    .open()
    .then(() => console.log('open'))
    .catch(() => console.log('error'))

// expect 'error'
// But 'open'
EternalC0der commented 1 year ago

Hey, as it is mentioned in the document you have to pass --rpc-secret argument to aria2c CLI.

image

Rewrite0 commented 1 year ago

Yes, I set rpc secret through aria2.conf. I hope to verify the secret when aria2.open(). Instead of getting JSONRPCError: Unauthorized during method execution