Deluge RPC protocol / Ruby implementation
Posted: Mon May 12, 2014 7:55 am
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
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