aboutsummaryrefslogtreecommitdiff
path: root/examples/hyper-examples/README.md
blob: bffdb30c9fd1becdacbe7bfe24b35a0911b68769 (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
# 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/)