termux-api icon indicating copy to clipboard operation
termux-api copied to clipboard

Add API for binding specific process or session to network

Open t1m013y opened this issue 5 months ago • 0 comments

Feature description

I need to bind specific processes or Termux sessions to the tun interface while using other processes/sessions with the normal network. I can't just bind the process to the specific network interface due to Android system limitations (I have unrooted phone and currently can't root it). For example, curl <some_url> --interface tun1 doesn't work.

I need this feature to set up a SOCKS proxy server that redirects requests to tun network while other Termux sessions and apps making connections through normal network.

Reference implementation

Have you checked if the feature is accessible through the Android API?

Yes, bindProcessToNetwork.

Do you know of other open-source apps that has a similar feature as the one you want? (Provide links)

No. Please tell me if you know any app that can bind to tun and set up a SOCKS proxy.

t1m013y avatar May 08 '25 17:05 t1m013y