我试了几个都只支持 HTTP(S) 和 WS(S)
1
securityCoding 2022-12-27 10:42:29 +08:00
私有协议怎么给你支持?
|
2
me221 2022-12-27 10:45:06 +08:00
BloomRPC ?
|
3
mmr OP @securityCoding 我不太了解这个,看他的代码是基于 POST 发送的……。
```python def _request( self, method: RpcMethod, arguments: Optional[Dict[str, Any]] = None, ids: Optional[_TorrentIDs] = None, require_ids: bool = False, timeout: Optional[_Timeout] = None, ) -> dict: """ Send json-rpc request to Transmission using http POST """ if not isinstance(method, str): raise ValueError("request takes method as string") if arguments is None: arguments = {} if not isinstance(arguments, dict): raise ValueError("request takes arguments as dict") ids = _parse_torrent_ids(ids) if len(ids) > 0: arguments["ids"] = ids elif require_ids: raise ValueError("request require ids") query = {"tag": self._sequence, "method": method, "arguments": arguments} self._sequence += 1 start = time.time() http_data = self._http_query(query, timeout) elapsed = time.time() - start self.logger.info("http request took %.3f s", elapsed) ``` |