SkillAgentSearch skills...

NetChecker

No description available

Install / Use

/learn @shakhzodsunnatov/NetChecker
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<p align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/e18f105c-fc88-4628-9844-2423e4c449d0" width="400"> <source media="(prefers-color-scheme: light)" srcset="https://github.com/user-attachments/assets/734078db-33b8-41a4-a917-4aec963a0b70" width="400"> <img alt="NetChecker Logo" src="https://github.com/user-attachments/assets/734078db-33b8-41a4-a917-4aec963a0b70" width="400"> </picture> </p> <h1 align="center">NetChecker</h1> <p align="center"> <strong>The Ultimate Network Traffic Inspector for iOS & macOS</strong><br> Debug, mock, and intercept HTTP/HTTPS requests like a pro — Charles Proxy, built right into your app. </p> <p align="center"> <a href="https://swift.org"><img src="https://img.shields.io/badge/Swift-5.9+-F05138?style=flat-square&logo=swift&logoColor=white" alt="Swift 5.9+"></a> <a href="https://developer.apple.com/ios/"><img src="https://img.shields.io/badge/iOS-16.0+-007AFF?style=flat-square&logo=apple&logoColor=white" alt="iOS 16.0+"></a> <a href="https://developer.apple.com/macos/"><img src="https://img.shields.io/badge/macOS-13.0+-007AFF?style=flat-square&logo=apple&logoColor=white" alt="macOS 13.0+"></a> <a href="https://swift.org/package-manager/"><img src="https://img.shields.io/badge/SPM-Compatible-brightgreen?style=flat-square&logo=swift&logoColor=white" alt="SPM Compatible"></a> <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow?style=flat-square" alt="MIT License"></a> </p> <p align="center"> <a href="#-features">Features</a> • <a href="#-installation">Installation</a> • <a href="#-quick-start">Quick Start</a> • <a href="#-documentation">Documentation</a> • <a href="#-contributing">Contributing</a> </p>

Why NetChecker?

Stop switching between your app and external proxy tools. NetChecker brings professional-grade network debugging directly into your development workflow — with zero configuration and a beautiful native UI.

// That's it. One line to start.
TrafficInterceptor.shared.start()

📸 Screenshots

<p align="center"> <img width="180" alt="Shake Inspector" src="https://github.com/user-attachments/assets/003cdd12-9abc-41f3-b19e-88ee0497c45a" /> <img width="180" alt="Menu Options" src="https://github.com/user-attachments/assets/223f364d-518f-4275-b01b-acf45c9c6f82" /> <img width="180" alt="Edit & Retry" src="https://github.com/user-attachments/assets/6cf31d28-f0f0-4adc-9e21-3bf49e03cb11" /> <img width="180" alt="Traffic List" src="https://github.com/user-attachments/assets/fb76cf9d-4b36-45bf-a7a7-fbc88e731026" /> </p> <p align="center"> <em>Shake Inspector • Menu Options • Edit & Retry • Traffic List • Request Details</em> </p>

🎭 Mock Rules

<p align="center"> <img width="180" alt="Mock Rules List" src="https://github.com/user-attachments/assets/f5022f7a-b304-45ef-ba3f-fbc51a52b8d7" /> <img width="180" alt="Edit Mock Rule" src="https://github.com/user-attachments/assets/a2b32b58-54be-4931-8288-facfdc4f75d6" /> <img width="180" alt="Create Mock Rule" src="https://github.com/user-attachments/assets/3b249884-3f3d-4ab3-b709-5d276a17abc8" /> </p> <p align="center"> <em>Mock Rules List • Edit Mock Rule • Create Mock Rule</em> </p>

⏸️ Breakpoints

<p align="center"> <img width="180" alt="IMG_1889" src="https://github.com/user-attachments/assets/c8aa0613-322c-45e0-8a48-55be34dd9800" /> <img width="180" alt="IMG_1892" src="https://github.com/user-attachments/assets/9121c223-9266-49c5-af35-3f093fe686f2" /> <img width="180" alt="IMG_1893" src="https://github.com/user-attachments/assets/0bbabaec-2c26-4bd5-8815-226c264eb618" /> <img width="180" alt="Screenshot" src="https://github.com/user-attachments/assets/e7ea3d7f-39d1-460a-876d-1f820a2238ad" /> </p> <p align="center"> <em>Breakpoints List • Paused Request • Edit & Resume • Request Modification</em> </p>

✨ Features

<table> <tr> <td width="50%">

🔍 Real-Time Traffic Monitoring

Capture every HTTP/HTTPS request your app makes. See requests as they happen with live updates.

📊 Detailed Request Analysis

  • Headers, body, query parameters
  • Cookies inspection
  • JSON syntax highlighting
  • Binary data preview

⏱️ Performance Timing

Visual waterfall charts showing:

  • DNS lookup
  • TCP connection
  • TLS handshake
  • Time to first byte
  • Content download
</td> <td width="50%">

🎭 Powerful Mocking Engine

Create mock responses without touching your backend:

  • URL pattern matching (regex support)
  • Custom status codes & headers
  • Simulated delays & errors
  • Priority-based rule matching

⏸️ Request Breakpoints

Pause, inspect, and modify requests in real-time:

  • Edit headers on-the-fly
  • Modify request body
  • Change URL endpoints
  • Auto-resume with timeout

🌍 Environment Switching <sup><kbd>Coming Soon</kbd></sup>

Switch between environments instantly:

  • Dev / Staging / Production
  • Quick URL overrides
  • Per-host configuration
  • Environment variables
</td> </tr> </table>

More Powerful Features

| Feature | Description | |---------|-------------| | 🔄 Edit & Retry | Modify any captured request and resend it instantly | | 📋 Export to cURL | Copy any request as a cURL command | | 📦 HAR Export | Export traffic sessions in standard HAR format | | 🔐 SSL Inspection | View TLS version, cipher suites, and certificate chains | | 🎨 Native SwiftUI | Beautiful, responsive UI that feels right at home | | 💾 Persistent Rules | Mock rules and breakpoints survive app restarts | | 🚀 Zero Dependencies | Pure Swift — no third-party libraries required |


📦 Installation

Swift Package Manager

Add NetChecker to your project using Xcode:

  1. Go to File → Add Package Dependencies
  2. Enter the repository URL:
    https://github.com/shakhzodsunnatov/NetChecker.git
    
  3. Select Up to Next Major Version with 1.2.0

Or add it to your Package.swift:

dependencies: [
    .package(url: "https://github.com/shakhzodsunnatov/NetChecker.git", from: "1.2.0")
]

Then add the product to your target:

.target(
    name: "YourApp",
    dependencies: [
        .product(name: "NetCheckerTraffic", package: "NetChecker")
    ]
)

🚀 Quick Start

Option 1: Shake-to-Open (Recommended)

The easiest way to integrate NetChecker — just add the .netChecker() modifier:

import SwiftUI
import NetCheckerTraffic

@main
struct MyApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
                .netChecker()  // ← Shake device to open inspector!
        }
    }
}

That's it! Shake your device to open the traffic inspector. No UI changes needed.

Option 2: Tab-Based Integration

For permanent access, add a Traffic tab:

import SwiftUI
import NetCheckerTraffic

struct ContentView: View {
    var body: some View {
        TabView {
            YourMainView()
                .tabItem { Label("Home", systemImage: "house") }

            TrafficListView()  // ← Add this tab
                .tabItem { Label("Network", systemImage: "network") }
        }
        .onAppear {
            TrafficInterceptor.shared.start()
        }
    }
}

Option 3: Manual Start Only

If you just want interception without UI:

import NetCheckerTraffic

// In your App's init or AppDelegate
TrafficInterceptor.shared.start()

📱 The .netChecker() Modifier

The simplest way to add network debugging to your app:

ContentView()
    .netChecker()

Features

  • Shake to Open: Shake your device to instantly open the traffic inspector
  • Full Inspector UI: Traffic list, environment switching, mock rules, and settings
  • Zero UI Changes: Works with any app structure — tabs, navigation, or custom layouts
  • Presentation Styles: Choose between sheet or full-screen cover

Configuration Options

// Default: shake-to-open with sheet presentation
.netChecker()

// Disable shake gesture (use programmatic trigger)
.netChecker(triggerOnShake: false)

// Full screen presentation
.netChecker(presentationStyle: .fullScreenCover)

// Disable in production
.netChecker(enabled: false)

// Alternative name
.trafficInspector()

Conditional Enablement

ContentView()
    #if DEBUG
    .netChecker()
    #endif

📖 Documentation

Interception Levels

Choose the level of detail you need:

// Full interception — headers + body + timing
TrafficInterceptor.shared.start(level: .full)

// Basic — works with all URLSession configurations
TrafficInterceptor.shared.start(level: .basic)

// Manual — for custom URLSession setups
TrafficInterceptor.shared.start(level: .manual)

Configuration Options

Fine-tune the interceptor to your needs:

var config = InterceptorConfiguration()

// Capture only specific hosts
config.captureHosts = ["api.myapp.com", "cdn.myapp.com"]

// Ignore noisy hosts
config.ignoreHosts = ["analytics.com", "crashlytics.com"]

// Limit memory usage
config.maxRecords = 500

// Redact sensitive headers in logs
config.redactedHeaders = ["Authorization", "X-API-Key"]

TrafficInterceptor.shared.start(configuration: config)

🎭 Mocking API Responses

Create mock responses without a backend:

let mockEngine = MockEngine.shared

// Mock a JSON response
mockEngine.mockJSON(
    url: "*/api/users/*",
    json: """
    {
        "id": 1,
        "name": "John Doe",
        "email": "john@example.com"
    }
    """,
    statusCode: 200
)

// Simulate network errors
mockEngine.mockError(
    url: "*/api/payments/*",
    error: .networkError(.notConnectedToInternet)
)

// Add artificial latency
mockEngine.mockDelay(
    url: "*/api/slow-endpoint",
    seconds: 3.0
)

Mock Rule Priority

Rules are matched in priority order:

let rule = MockRule(
    matching: MockMatching(urlPattern: "*/api/*", method: .post),
    a

Related Skills

View on GitHub
GitHub Stars63
CategoryDevelopment
Updated4d ago
Forks4

Languages

Swift

Security Score

75/100

Audited on Mar 29, 2026

No findings