Development Guide
Setting Up Development Environment
-
Requirements:
- Go 1.20 or later
- Git
- Make (optional, for using Makefile)
-
Clone the repository:
git clone https://github.com/kutovoys/xray-checker.gitcd xray-checker- Install dependencies:
go mod download- Build the project:
make build# orgo build -o xray-checkerProject Structure
.├── checker/ # Proxy checking logic├── config/ # Configuration handling├── geo/ # Geo files (geoip.dat, geosite.dat)├── logger/ # Structured logging├── metrics/ # Prometheus metrics├── models/ # Data models├── subscription/ # Subscription parsing and management├── web/ # Web interface, API, and assets├── xray/ # Xray integration and runner├── go.mod # Go modules file└── main.go # Application entry pointMaking Changes
- Create a new branch:
git checkout -b feature/your-feature-name- Make your changes
- Run tests
- Update documentation if needed
- Submit a pull request
Local Testing
- Set up test configuration:
export SUBSCRIPTION_URL=your_test_subscription- Run in development mode:
go run main.go- Run with specific features:
go run main.go --proxy-check-method=status --metrics-protected=true