https://github.com/bertrandmartel/external-ip
Small server written in go exposing a single API displaying inbound & outbound IP
https://github.com/bertrandmartel/external-ip
echo-server go ip
Last synced: 12 months ago
JSON representation
Small server written in go exposing a single API displaying inbound & outbound IP
- Host: GitHub
- URL: https://github.com/bertrandmartel/external-ip
- Owner: bertrandmartel
- License: mit
- Created: 2020-02-05T23:50:27.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-04-26T19:54:14.000Z (almost 5 years ago)
- Last Synced: 2025-01-03T20:12:25.582Z (about 1 year ago)
- Topics: echo-server, go, ip
- Language: Go
- Size: 5.86 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# API exposing inbound/outbound IP
[](https://github.com/bertrandmartel/external-ip/actions?workflow=build%20and%20deploy)
[](https://goreportcard.com/report/github.com/bertrandmartel/external-ip)
[](https://hub.docker.com/r/bertrandmartel/external-ip)
[](LICENSE.md)
Small server written in go exposing a single API displaying inbound & outbound IP
* outbound IP(s) is(are) retrieved using [ipify API](https://www.ipify.org/)
* inbound IP(s) is(are) retrieved using [Google DNS API](https://dns.google.com/)
Environment variables :
| name | description |
|----------|-------------|
| PORT | server port |
| HOSTNAME | hostname to check inbound ip |
## Using Docker
* DockerHub
```
docker run -p 4242:4242 -e PORT=4242 -e HOSTNAME=example.com -it bertrandmartel/external-ip
```
* locally
```
docker build . -t external-ip
docker run -p 4242:4242 -e PORT=4242 -e HOSTNAME=example.com -it external-ip
```
## Using Go
```
go install
go run ./main.go
```
or
```
go install
go build
./external-ip
```
## Dependencies
* [echo](https://echo.labstack.com/)