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-checker
Project Structure
.├── checker/ # Proxy checking logic├── config/ # Configuration handling├── metrics/ # Prometheus metrics├── models/ # Data models├── parser/ # Subscription parser├── runner/ # Xray process runner├── subscription/ # Subscription management├── web/ # Web interface├── xray/ # Xray integration├── go.mod # Go modules file└── main.go # Application entry point
Making 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