about summary refs log tree commit diff
path: root/README.md
blob: f49d182a79604269b6f49419e52c8a8850c35e21 (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
36
37
38
39
40
41
42
43
**piper**  
make a get request and you'll get your IP address. with a but more
to facilitate easy use in a dynamic dns kinda situation.

*name origin*  
"it's a thing that tells you your IP"  
-> "gets your IP?"  
-> "IPer"  
-> "piper!"

send an `Authorization` header with your request to track changes in your IP
address. The value you provide can only contain Base-64 characters, but does
not have to be valid Base-64.

If a request is received with an `Authorization` header, piper will compare the
IP the request came from with the last IP to use that `Authorization` value.
There are three possible situations and two responses:

A `200` status code will be returned, with an IP in the body, if:  
- A request has never been made with the provided auth value  
- The last request to use the auth value came from a different IP address

A `302` status code will be returned, with no body, if:  
- The last request to use the auth value comes from the same IP address

There are multiple `Content-Type`s supported. Below is a list of types and
example responses. If you do not provide a `Content-Type`, plaintext is assumed.

**`application/json`**  
```json
{"ip": "127.0.0.1"}
```

**`text/plain`**  
```
127.0.0.1
```

**`application/xml`**  
```xml
<?xml version="1.0" encoding="utf-8"?>
<ip>1.1.1.1</ip>
```