Add WiFi hotspot port forwarding with bind address selection#7
Closed
steffen-heil-secforge wants to merge 1 commit into
Closed
Add WiFi hotspot port forwarding with bind address selection#7steffen-heil-secforge wants to merge 1 commit into
steffen-heil-secforge wants to merge 1 commit into
Conversation
fe2267f to
55615ed
Compare
Enables port forwards to bind to WiFi hotspot interface, allowing devices connected to the Android device's hotspot to access forwarded services. This complements the existing localhost and all-interfaces bind options. Features: - New bind address option for WiFi hotspot (access_point constant) - Automatic detection of hotspot interface IP via NetworkInterface API - Background monitoring that retries failed hotspot forwards when hotspot state changes (activated, deactivated, IP changes) - UI updates: bind address spinner in port forward editor with three options (localhost, all interfaces, WiFi hotspot) - Visual security warnings for network-exposed binds (all interfaces and hotspot) - Database schema migration from version 26 to version 27 adds bindaddr column to portforwards table - Thread-safe bridge list access in TerminalManager with synchronized helper methods to prevent concurrent modification during background monitoring - Sentinel-based state change detection that tracks last known hotspot IP without polluting state from UI queries - Filtering logic that excludes cellular interfaces (rmnet*, v4-rmnet*, clat*, ccmni*) from hotspot detection Implementation details: - NetworkUtils provides getHotspotInterfaceIP() for IP detection and hasAccessPointStateChanged() for state monitoring - TerminalManager.ApStateMonitorTask runs every 10 seconds to check for hotspot state changes and retry failed access_point forwards - getBridgesCopy(), hasBridges(), getBridgeCount() helpers ensure thread-safe iteration over active connection bridges - Port forward validation prevents binding to access_point when hotspot is not active - Removed unused Message import 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
5399731 to
c0a76ef
Compare
Owner
Author
|
Superseded by #8 (ported to new Kotlin/Compose/Room architecture) |
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.
Summary
Enables port forwards to bind to the WiFi hotspot interface, allowing devices connected to the Android device's hotspot to access forwarded services. This complements the existing localhost and all-interfaces bind options.
Features
WiFi Hotspot Binding
access_pointconstant)UI Enhancements
Database Migration (v26 → v27)
Thread Safety
Implementation Details
Network Detection (NetworkUtils)
Background Monitoring (TerminalManager.ApStateMonitorTask)
Validation
Database Schema
```sql
ALTER TABLE portforwards ADD COLUMN bindaddr TEXT DEFAULT 'localhost';
```