Skip to content

songlim327/diglett

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Diglett

A port check tool written in Golang

Go Version

🏔️ What is Diglett?

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.

🌟 Getting Started

Docker

docker run -d --name diglett -p 8080:8080 emokid327/diglett:latest

Usage

Check Port Forward Validity

POST /checkCheck if port is open or closed on specific IP Address

Body

    {
        "address": "1.1.1.1",
        "port": "80",
    }

Response

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"}

Example cURL

curl -X POST -H "Content-Type: application/json" --data '{"address":"1.1.1.1", "port": "80"}' http://localhost:8080/check

Get Public IP Address

GET /ipv4Retrieve client public IP address

Body

  • no body required

Response

http code content-type response
200 text/plain <client_public_ip>

Example cURL

curl http://localhost:8080/ipv4

"Buy Me A Coffee"

About

A port check tool written in Golang

Resources

Stars

Watchers

Forks