Hi.
I'm working on a client library for communicating with deluged. As documentation is sparse, and there were no rencode implementation available for Ruby, most of my work has been to review the source code of the Deluge UI and trying to re-implement it in Ruby. The only way I can test the implementation is in trying to communicate with deluged. This is where I'm stuck.
I can establish an SSL connection and send data, but I get no reply from deluged, and there's no output from deluged loglevel DEBUG
My testcase is to send the following bytes:
[68, 0, 0, 0, 26, 120, 156, 179, 182, 118, 100, 128, 0, 70, 19, 171, 204, 188, 180, 124, 235, 122, 155, 250, 250, 122, 0, 42, 190, 5, 70]
...where the header part is:
[68, 0, 0, 0, 26] // Meaning 'D' + 4-byte integer 26, network byte order
...and the body:
[120, 156, 179, 182, 118, 100, 128, 0, 70, 19, 171, 204, 188, 180, 124, 235, 122, 155, 250, 250, 122, 0, 42, 190, 5, 70] // ZLib-compressed data
... which decompressed is the following rencode:
[59, 59, 65, 0, 0, 0, 0, 0, 0, 0, 1, 52, 58, 105, 110, 102, 111, 59, 127, 60, 127, 127, 127]
... which, if correctly implemented, should mean:
[[1, 'info', [], {}]] // A single RPC Request: number 1, query daemon version, empty list of args, empty dictionary of kwargs
But, I don't get a single byte in response, and deluged doesn't print anything other than "rpcserver:203 Deluge Client connection made from: 192.168.1.2:53391". I would greatly appreciate if someone could verify that the rencode is correct, or tell me if there's some other procedure I have to perform (such as authentication) before querying for info.
My implementation of rencode can be found at https://github.com/mikaelwikman/rencode
Thanks
Deluge RPC protocol / Ruby implementation
-
- New User
- Posts: 4
- Joined: Sun May 11, 2014 5:46 pm
-
- New User
- Posts: 4
- Joined: Sun May 11, 2014 5:46 pm
Re: Deluge RPC protocol / Ruby implementation
I tried the same message using the python implementation of rencode. It is better optimized, using combined typecode+value in integers, lists and dictionaries. I still get absolute silence from deluge though..
Output from python rencode: [193, 196, 1, 132, 105, 110, 102, 111, 192, 102]
I also tried both approaches with "daemon.info", but without any luck.
Output from python rencode: [193, 196, 1, 132, 105, 110, 102, 111, 192, 102]
I also tried both approaches with "daemon.info", but without any luck.
-
- New User
- Posts: 4
- Joined: Sun May 11, 2014 5:46 pm
Re: Deluge RPC protocol / Ruby implementation
As usual when stuck with a bug, the problem was rather obvious.
I was reading the source for development version 4.0, but the daemon was running 3.3. That version disregards anything not "daemon.login" before authenticated, hence no reply to daemon.info.
It all works now. I'll make another post when I've uploaded the client lib to GitHub, if someone's interested.
I was reading the source for development version 4.0, but the daemon was running 3.3. That version disregards anything not "daemon.login" before authenticated, hence no reply to daemon.info.
It all works now. I'll make another post when I've uploaded the client lib to GitHub, if someone's interested.
-
- New User
- Posts: 4
- Joined: Sun May 11, 2014 5:46 pm
Re: Deluge RPC protocol / Ruby implementation
Okay, so I've uploaded it to Github: https://github.com/mikaelwikman/deluge-ruby