Created
June 27, 2016 10:11
-
-
Save trufae/b67656d8ede650b88343a8039cdc5b67 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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