A modern IP information service inspired by ifconfig.me, built with Go and Fiber.
- Get detailed information about your connection
- Clean and responsive web interface
- RESTful API endpoints
- Command-line interface support
- Docker support
- High performance using Fiber framework
- Uses GIMU Architecture for better scalability and maintainability
- Go 1.21+
- Fiber - Web framework
- GIMU Architecture (Designed by @tinchoram)
- HTML/CSS for frontend
- Docker for containerization
This project follows the GIMU architecture, a structure designed by @tinchoram to simplify and scale applications efficiently. The architecture consists of the following layers:
| Layer | Description |
|---|---|
| Gateways | Handles external interactions (e.g., HTTP requests, APIs, databases) |
| Interactions | Implements business logic and use cases |
| Models | Defines the domain entities and data structures |
| Utils | Provides utility functions for various tasks |
.
├── Dockerfile
├── README.md
├── go.mod
├── go.sum
├── cmd/
│ └── main.go # Entry point of the application
├── pkg/
│ ├── gateways/ # Handles HTTP requests and headers
│ │ ├── gateway.go
│ ├── interactions/ # Business logic (IP processing, API responses)
│ │ ├── ip_service.go
│ ├── models/ # Defines the data structures
│ │ ├── ip_info.go
│ ├── utils/ # Utility functions (formatting, logging)
│ │ ├── formatter.go
├── views/
│ └── index.html
└── public/
└── css/
└── styles.css
📌 Advantages of GIMU:
- Clear separation of concerns (each layer has a single responsibility).
- Easier testing (mocks can be injected into interactions).
- Scalability (you can add new gateways, interactions, and models without modifying the core logic).
- Better maintainability (logical separation makes debugging and updates easier).
| Endpoint | Description |
|---|---|
/ |
Returns IP address for curl, web interface for browsers |
/ip |
Returns only the IP address |
/ua |
Returns User Agent |
/lang |
Returns Accept-Language |
/encoding |
Returns Accept-Encoding |
/mime |
Returns accepted MIME types |
/charset |
Returns Accept-Charset |
/forwarded |
Returns X-Forwarded-For |
/headers |
Returns all request headers |
/all |
Returns all information in plain text |
/all.json |
Returns all information in JSON format |
/ping |
Returns request details (headers, method, IP, etc.) |
/details.json |
Returns extended information with timestamp |
- Go 1.21+
- Docker (optional)
- Clone the repository:
git clone https://github.com/tinchoram/ifconfig.git
cd ifconfig- Install dependencies:
go mod download- Run the application:
go run cmd/main.goThe service will be available at http://localhost:3000
- Build the Docker image:
docker build -t ifconfig .- Run the container:
docker run -p 3000:3000 ifconfigGet your IP address:
curl localhost:3000Get all information in JSON format:
curl localhost:3000/all.jsonGet all headers:
curl localhost:3000/headersGet extended details:
curl localhost:3000/details.json- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m '[Module] Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Give a ⭐️ if this project helped you!
- Make sure to handle CORS and security considerations in production.
- The service is designed to be lightweight and fast.
- Contributions and suggestions are welcome.
Made with ❤️ by @tinchoram