Diglett is a minimalist, port check rest API service written in Golang. It is useful in identifying whether a port has been open/closed to the public network.
docker run -d --name diglett -p 8080:8080 emokid327/diglett:latest
POST /check
Check if port is open or closed on specific IP Address
{
"address": "1.1.1.1",
"port": "80",
}
http code | content-type | response |
---|---|---|
200 |
application/json |
{"message":"port 80 open on 1.1.1.1"} |
400 |
application/json |
{"message":"invalid payload"} |
406 |
application/json |
{"message":"65536 is not a valid port/IP address"} |
curl -X POST -H "Content-Type: application/json" --data '{"address":"1.1.1.1", "port": "80"}' http://localhost:8080/check
GET /ipv4
Retrieve client public IP address
- no body required
http code | content-type | response |
---|---|---|
200 |
text/plain |
<client_public_ip> |
curl http://localhost:8080/ipv4