Skip to content

Development Guide

Setting Up Development Environment

  1. Requirements:

    • Go 1.20 or later
    • Git
    • Make (optional, for using Makefile)
  2. Clone the repository:

Terminal window
git clone https://github.com/kutovoys/xray-checker.git
cd xray-checker
  1. Install dependencies:
Terminal window
go mod download
  1. Build the project:
Terminal window
make build
# or
go 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

  1. Create a new branch:
Terminal window
git checkout -b feature/your-feature-name
  1. Make your changes
  2. Run tests
  3. Update documentation if needed
  4. Submit a pull request

Local Testing

  1. Set up test configuration:
Terminal window
export SUBSCRIPTION_URL="your_test_subscription"
  1. Run in development mode:
Terminal window
go run main.go
  1. Run with specific features:
Terminal window
go run main.go --proxy-check-method=status --metrics-protected=true