feat: add macOS compatibility for networking and fix requirements - #5
Closed
Shxdy10 wants to merge 1 commit into
Closed
feat: add macOS compatibility for networking and fix requirements#5Shxdy10 wants to merge 1 commit into
Shxdy10 wants to merge 1 commit into
Conversation
Owner
|
closed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This Pull Request introduces full compatibility for macOS (Darwin) systems. Previously, the tool was restricted to Linux environments due to its reliance on the iproute2 suite and the /proc filesystem.
Key Changes
Platform-Aware Utilities: Updated core/platform_utils.py to identify the Darwin kernel and bypass Linux-specific process probing that caused crashes on startup.
BSD Networking Support: Re-implemented get_active_interfaces in core/interface.py to use ifconfig and netstat. This allows the tool to correctly identify active hardware interfaces (e.g., en0) on macOS.
Darwin Routing Logic: Updated core/router.py to use the BSD route command for interface binding. This serves as a functional alternative to Linux Network Namespaces (ip netns), forcing application traffic through the specified gateway.
Dependency Fix: Resolved a version conflict in requirements.txt specifically regarding the click library to ensure a stable environment across platforms.
Testing Environment
Hardware: MacBook Air (Apple Silicon M5)
OS: macOS 15+
Verification:
Confirmed routing table modifications using netstat -nr.
Verified that Linux-specific code remains isolated in else blocks to prevent regressions for existing users.