Skip to content

Run an axum HTTP server as a Tor hidden service using arti.

License

Notifications You must be signed in to change notification settings

jgraef/arti-axum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

arti-axum

crates.io Documentation MIT

This crate allows you to run your axum http server as a tor hidden service using arti.

Example

For a full example, take a look at hello_world.rs.

let tor_client = TorClient::create_bootstrapped(TorClientConfig::default()).await?;

let (onion_service, rend_requests) = tor_client.launch_onion_service(
    OnionServiceConfigBuilder::default()
        .nickname("hello-world".to_owned().try_into().unwrap())
        .build()?,
)?;

let stream_requests = handle_rend_requests(rend_requests);

let app = Router::new().route("/", routing::get(|| async { "Hello, World!" }));

println!("serving at: http://{}", onion_service.onion_name().unwrap());

arti_axum::serve(stream_requests, app).await;

About

Run an axum HTTP server as a Tor hidden service using arti.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages