Conversation
- Refactored launcher.py to include OS-specific imports and logging for Windows, macOS, and Linux. - Added LinuxNetworkMonitor class for Linux-specific network functionalities, including interface management and device control. - Introduced MacOSNetworkMonitor class for macOS-specific network functionalities, including interface management and device control. - Updated monitor.py to utilize platform-specific network monitor classes for better modularity and maintainability. - Improved error handling and logging throughout the codebase for better debugging and user feedback. - Added new dependencies for macOS and Linux in requirements.txt to support platform-specific features.
…iting and blocking
…, installation scripts, documentation, and CI workflow.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 580f416924
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for iface in self.get_interfaces(): | ||
| iface_ip = iface.get('ip', '') | ||
| if iface_ip and iface_ip.rsplit('.', 1)[0] == gateway_ip.rsplit('.', 1)[0]: | ||
| return iface.get('name') |
There was a problem hiding this comment.
Match gateway subnet without assuming /24 on Windows
The Windows default-interface selection compares only the first three octets (rsplit('.', 1)), which implicitly assumes a /24. On networks with larger subnets (e.g., 10.0.0.0/16 or 172.16.0.0/12), the gateway and host IP can differ in the last octet block, so this comparison fails and the code falls back to a potentially unrelated interface (or None). That breaks later operations that rely on the default interface (e.g., ARP scanning) even though a valid interface exists.
Useful? React with 👍 / 👎.
| with open(rule_file, "w") as f: | ||
| f.write(f"table <limited_devices> {{ {ip} }}\n") | ||
| f.write(f"queue limit_q on en0 bandwidth {limit_kbps}Kb/s\n") | ||
| f.write("block return out quick on en0 from any to <limited_devices> queue limit_q\n") | ||
| f.write("block return in quick on en0 from <limited_devices> to any queue limit_q\n") |
There was a problem hiding this comment.
Avoid hardcoding en0 in macOS pf rules
The pf rules are hardcoded to en0, but many Macs use en1 (or another device) for Wi‑Fi. When the active interface is not en0, both the bandwidth limit and block rules won’t match any traffic, so the requested action silently has no effect. This shows up immediately for users on Wi‑Fi-only systems or with USB/Thunderbolt adapters.
Useful? React with 👍 / 👎.
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
Checklist: