Skip to content

shaahin/ShaNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ShaNet - Network & VPN Split Tunneling Testing Tool for macOS

A simple SwiftUI macOS application designed for network testing and VPN split tunneling validation. ShaNet provides three identical application bundles (BarApp, FooApp, WaldoApp) with different bundle IDs to test split tunneling scenarios.

🎯 Purpose & Use Cases

ShaNet was created to test VPN split tunneling capabilities, allowing developers and network administrators to:

  • Validate VPN Routing: Test which traffic goes through VPN vs. direct connection
  • IP Location Testing: Verify geolocation and IP address changes across different network paths
  • Download Performance: Measure download speeds under various network conditions

🏗️ Architecture: Three Identical Bundles

The project contains three separate application targets with identical functionality but different bundle IDs:

📦 BarApp, FooApp, WaldoApp

  • Identical Features: All three apps have the same functionality
  • Different Bundle IDs: Each app has a unique bundle identifier
  • Purpose: Test VPN split tunneling with different app identifiers
  • Use Case: Configure VPN to route traffic differently based on bundle ID

🔧 Core Features

Network Testing Capabilities

  • TCP/IP Testing: HTTP requests, image loading, file downloads
  • UDP Testing: STUN protocol for public IP detection
  • Custom UDP: Direct communication with custom servers

IP Location & Geolocation

  • Real-time IP Detection: Get current public IP address
  • Geolocation Data: Country, city, ISP information

Performance Testing

  • Download Speed Measurement: Real-time bandwidth testing
  • Concurrent Downloads: Test multiple simultaneous file transfers

🚀 Getting Started

Prerequisites

  • macOS 12.0 or later
  • Xcode 14.0 or later
  • Network connectivity for testing

Building the Application

  1. Clone the repository:

    git clone <repository-url>
    cd ShaNet
  2. Open in Xcode:

    open ShaNet.xcodeproj
  3. Select your target:

    • Choose BarApp, FooApp, or WaldoApp (all identical)
    • Each has a different bundle ID for split tunneling testing
  4. Build and run:

    • Press Cmd+R or click the Run button
    • The app will launch and display network information

Installing Downloaded Apps

If you downloaded the apps from a GitHub release and see a security warning:

Option 1: System Preferences → Security & Privacy → "Allow Anyway" Option 2: Terminal: sudo xattr -rd com.apple.quarantine /path/to/AppName.app

⚙️ Configuration

Server Endpoints

The app uses various public URLs for testing. You can modify most of these in ShaNet/URLs.swift:

// IP Location Services
static let ipLocationAPI = "https://ipapi.co/json/"

// Download Testing
static let randomImageAPI = "https://picsum.photos/200"
static let largeFileDownload = "https://downloads.raspberrypi.com/..."

// UDP Testing
static let stunServer = "stun.l.google.com"

The custom UDP server address and port can be configured directly in the app's UI and will be saved between sessions.

Network Permissions

The app requires network permissions configured in ShaNet.entitlements:

  • Outbound network connections
  • UDP/TCP protocol access

🧪 Testing Scenarios

VPN Split Tunneling Validation

  1. Baseline Test: Run app without VPN to establish baseline metrics
  2. VPN Test: Connect to VPN and run same tests
  3. Split Tunnel Test: Configure VPN to exclude specific bundle IDs
  4. Compare Results: Analyze IP changes and download speed differences

Network Performance Analysis

  1. Direct Connection: Test download speeds on direct internet
  2. VPN Connection: Test speeds through VPN tunnel
  3. Concurrent Testing: Run multiple apps simultaneously
  4. Performance Comparison: Compare download speeds and bandwidth

IP Location Verification

  1. IP Location Check: Verify current public IP and location
  2. VPN IP Check: Confirm IP changes when VPN is active
  3. Split Tunnel IP: Test IP routing with split tunneling enabled

🤝 Contributing

Contributions are welcome! Feel free to submit issues and pull requests.

📄 License

This project is open source.


Disclaimer: The public URLs found in this project are gathered from the internet for testing purposes. Users are responsible for the results and fair usage of these services.

About

A macOS SwiftUI tool for validating VPN split tunneling and network configurations. It provides three identical apps with distinct bundle IDs to test app-specific routing rules, alongside built-in features for IP geolocation, TCP/UDP testing, and performance measurement.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors