summaryrefslogtreecommitdiff
path: root/examples/cli.rs
blob: 39c4b0fbffc9b0b66dd571743c420dcc51f6677b (plain)
1
2
3
4
5
6
7
8
9
fn main() {
    let s = torctl::spawn("/usr/bin/tor", "tor-data", "").unwrap();
    s.setconf(&[("SocksPort", Some("10245"))]).unwrap();
    dbg!(s.getconf(&["ContactInfo", "DataDirectory", "HiddenServiceOptions"]).unwrap());
    dbg!(s.getinfo(&["version", "config-text", "md/all"]).unwrap());
    s.quit().unwrap();

    std::thread::sleep(std::time::Duration::from_secs(500));
}