blob: 8e625faeffb2861cbc5bbfbea5d11ccc81c90548 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# Examples using hyper with Arti
This directory contains examples demonstrates how to use `hyper` in combination with Arti.
## Overview
| Example | Run | Description |
| --- | --- | --- |
| [hyper-http-client-example](src/bin/hyper-http-client-example.rs) | `cargo run --bin hyper-http-client-example` | Make single HTTP/1.1 request using Arti. |
| [hyper-http-hs-example](src/bin/hyper-http-hs-example.rs) | `cargo run --bin hyper-http-hs-example` | Implements a simple HTTP/1.1 hidden service using Arti and hyper. |
## Example details
### hyper-http-client-example
**Make a single request over Tor using hyper.**
It makes a `GET` request to `https://check.torproject.org/api/ip`. If the response contains `"IsTor:true"`, you successfully used the Tor network to make the request.
### hyper-http-hs-example
**Create a hidden service using hyper.**
This example makes an instance of a hidden service using hyper in combination with Arti.
## Relevant documentation
Read the hyper documentation to learn more about how to use hyper to understand these examples better.
- [Docs.rs hyper](https://docs.rs/hyper/latest/hyper/)
> [!WARNING]
> **Notice for MacOS users:** This example uses `native-tls` which on MacOS might fail to perform a TLS handshake due to a known bug.
> This will be fixed once `security-framework` 3.5.1 is used by `native-tls`. View issue [#2117](https://gitlab.torproject.org/tpo/core/arti/-/issues/2117) for more details.
|