oh-my-posh/website/docs/segments/ipify.mdx

55 lines
1.5 KiB
Plaintext
Raw Normal View History

---
id: ipify
title: Ipify
sidebar_label: Ipify
---
## What
[Ipify][ipify] is a simple Public IP Address API, it returns your public IP Address in plain text.
## Sample Configuration
```json
{
"type": "ipify",
"style": "diamond",
"foreground": "#ffffff",
"background": "#c386f1",
"leading_diamond": "\ue0b6",
"trailing_diamond": "\uE0B0",
2022-03-27 01:12:47 -07:00
"template": "{{ .IP }}",
"properties": {
"cache_timeout": 5,
"http_timeout": 1000
}
}
```
## Properties
| Name | Type | Description |
| --------------- | -------- | -------------------------------------------------------------------------------------------------------------------- |
| `url` | `string` | The Ipify URL, by default IPv4 is used, use `https://api64.ipify.org` for IPv6 - defaults to `https://api.ipify.org` |
| `http_timeout` | `int` | How long may the segment wait for a response of the ipify API? - defaults to 20ms |
| `cache_timeout` | `int` | in minutes - How long you want your IP address cached - defaults to 10 min |
2022-02-01 03:10:46 -08:00
## Template ([info][templates])
:::note default template
```template
2022-02-01 03:10:46 -08:00
{{ .IP }}
```
:::
### Properties
| Name | Type | Description |
| ---- | -------- | ------------------------ |
| .IP | `string` | Your external IP address |
2022-04-20 09:43:59 -07:00
[templates]: /docs/configuration/templates
[ipify]: https://www.ipify.org/