Thank you for your interest in contributing to ipmap! We welcome contributions from the community.
- Check if the bug has already been reported in Issues
- Provide a clear description of the bug
- Include steps to reproduce the issue
- Attach relevant logs or error messages
- Check if the enhancement has already been suggested
- Provide a clear description of the proposed feature
- Explain the use case and benefits
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add or update tests as needed
- Ensure all tests pass (
go test ./... -v) - Run
go vet ./...to check for issues - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Clone the repository
git clone https://github.com/sercanarga/ipmap.git
cd ipmap
# Install dependencies
go mod tidy
# Build the project
go build -o ipmap .
# Run tests
go test ./... -v
# Run tests with coverage
go test ./... -v -cover
# Run static analysis
go vet ./...
# Run with verbose output
./ipmap -asn AS13335 -vipmap/
├── main.go # Entry point, CLI flags, go:embed VERSION
├── VERSION # Embedded version string
├── config/
│ ├── config.go # Global config, RNG, jitter, logging
│ └── loader.go # YAML config file loading
├── modules/
│ ├── scanner.go # Chrome 135 headers, uTLS transport
│ ├── request.go # HTTP client with retry, connection pool
│ ├── resolve_site.go # Worker pool, IP scanning, batch DNS
│ ├── get_site.go # Site discovery per IP
│ ├── get_domain_title.go # Domain title fetching
│ ├── helpers.go # Shared utilities (ExtractTitle)
│ ├── cache.go # Scan state persistence for resume
│ ├── validators.go # Input validation
│ ├── rate_limiter.go # Token bucket rate limiter
│ ├── dns_resolver.go # Batch reverse DNS lookups
│ ├── result_print.go # Result formatting and export
│ ├── interrupt_handler.go # Ctrl+C handling
│ └── calc_ip_address.go # CIDR to IP calculation
├── tools/
│ ├── find_asn.go # ASN scanning
│ └── find_ip.go # IP block scanning
└── README.md
- Follow Go conventions and best practices
- Use meaningful variable and function names
- Add comments for exported functions and complex logic
- Keep functions focused and concise
- Run
go fmtbefore committing - Run
go vetto catch common issues
- Write tests for new features
- Ensure all existing tests pass
- Aim for good test coverage (current: ~30%)
- Test edge cases and error conditions
- Place tests in
*_test.gofiles
# All tests
go test ./... -v
# Specific package
go test ./modules -v
# With coverage report
go test ./... -v -cover
# Run benchmarks
go test ./... -bench=.When modifying the scanner module:
- TLS Fingerprint: Use
utls.HelloChrome_Autofor latest Chrome fingerprint - Header Order: Maintain exact Chrome header order (not alphabetical)
- Accept-Encoding: Include
zstdfor Chrome 135+ - Jitter: Use
config.AddJitter()(0-200ms random delay) - User-Agent: Use Chrome 133+ versions only
- Referer: Rotate between Google, Bing, DuckDuckGo, Yahoo URLs
By contributing to ipmap, you agree that your contributions will be licensed under the MIT License.