new file: .gitignore
new file: Cargo.lock new file: Cargo.toml new file: src/main.rs
This commit is contained in:
commit
0e0371f4da
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/target
|
5106
Cargo.lock
generated
Normal file
5106
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
10
Cargo.toml
Normal file
10
Cargo.toml
Normal file
@ -0,0 +1,10 @@
|
||||
[package]
|
||||
name = "Gamal"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
arti-client = { version = "0.28.0", features = ["onion-service-client", "onion-service-service", "pt-client"] }
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
env_logger = "0.11.6"
|
||||
log = "0.4.20"
|
16
src/main.rs
Normal file
16
src/main.rs
Normal file
@ -0,0 +1,16 @@
|
||||
use arti_client::{config::onion_service::OnionServiceConfigBuilder, TorClient, TorClientConfig};
|
||||
use log::info;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
let config = TorClientConfig::default();
|
||||
if let Ok(tor_client) = TorClient::create_bootstrapped(config).await {
|
||||
info!("Bootstrapped");
|
||||
let onion_service_config = OnionServiceConfigBuilder::default().build().unwrap();
|
||||
if let Ok(es) = tor_client.launch_onion_service(onion_service_config) {
|
||||
info!("Onion name: {}", es.0.onion_name().unwrap());
|
||||
}
|
||||
} else {
|
||||
info!("Error with bootstrapping");
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user