Skip to content

Instantly share code, notes, and snippets.

@trufae
Created June 27, 2016 10:11
Show Gist options
  • Select an option

  • Save trufae/b67656d8ede650b88343a8039cdc5b67 to your computer and use it in GitHub Desktop.

Select an option

Save trufae/b67656d8ede650b88343a8039cdc5b67 to your computer and use it in GitHub Desktop.
import r2pipe
import asyncdispatch
proc test {.async.} =
let r2p = R2PipeHttp(url: "http://cloud.radare.org")
let res = await r2p.cmd("?V")
echo(res);
waitFor test();
import sockets, strutils
import httpclient
import asyncdispatch
type
R2PipeHttp = object
url*:string
proc cmd*(r: R2PipeHttp, c: string):Future[string] {.async.} =
var client = newAsyncHttpClient()
var resp = await client.request(r.url & "/cmd/" & c)
return resp.body;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment