Skip to content

Bind aMule's external-connection (EC) socket to its own network interface (#330) - #499

Merged
got3nks merged 1 commit into
amule-org:masterfrom
got3nks:feat/ec-bind-interface
Jul 16, 2026
Merged

Bind aMule's external-connection (EC) socket to its own network interface (#330)#499
got3nks merged 1 commit into
amule-org:masterfrom
got3nks:feat/ec-bind-interface

Conversation

@got3nks

@got3nks got3nks commented Jul 16, 2026

Copy link
Copy Markdown

Closes #330.

PR #281 added an interface bind (IP_UNICAST_IF / IP_BOUND_IF) that pins all of aMule's sockets — including the EC listener — to one interface. That prevents running ed2k/Kad over a VPN tunnel while keeping the external-control port on the LAN.

This decouples the EC listener. A new daemon-side setting, /ExternalConnect/ECNetworkInterface (empty = any), binds only aMule's EC acceptor, independent of the global P2P interface pin. It sits beside the existing ECAddress IP bind — the EC control channel now has both its own IP and its own interface.

  • The socket layer gains a per-server interface override; only the EC listener uses it. ed2k/Kad TCP + UDP, outbound connections and HTTP are untouched and keep following the global setting.
  • A "Bind to network interface" selector is added to the Connection → Remote Controls page (reusing the existing P2P label). Like the other EC-listener settings it is daemon-only: hidden in the remote GUI and not carried over EC (you cannot reconfigure the EC listener through the EC channel you are on). Restart-needed, consistent with the EC port/address.

No new translatable strings. Builds clean on macOS (monolithic, remote GUI, daemon). Verified at runtime: with the EC interface pinned, a loopback EC connection is refused while the pinned-interface IP connects, and the ed2k listen socket stays bound to all interfaces.

The interface bind added in amule-project#281 (IP_UNICAST_IF / IP_BOUND_IF) pins every
socket aMule opens — including the External Connection listener — to a single
interface, so ed2k/Kad cannot run over a VPN tunnel while the EC control port
stays on the LAN.

Decouple the EC listener with a new daemon-side setting,
/ExternalConnect/ECNetworkInterface (empty = any), that binds only aMule's EC
acceptor, independent of the global P2P interface pin. It sits beside the
existing ECAddress IP bind, giving the EC channel both its own IP and its own
interface.

CLibSocketServer gains a per-server interface override; only CExternalConnListener
uses it. ed2k/Kad TCP and UDP, outbound connections and HTTP keep following the
global setting untouched. A "Bind to network interface" selector is added to the
Remote Controls page (reusing the existing P2P label); like the other EC-listener
settings it is daemon-only — hidden in the remote GUI and not carried over EC —
and flagged restart-needed.
@got3nks
got3nks merged commit 1ec3cab into amule-org:master Jul 16, 2026
14 checks passed
@got3nks
got3nks deleted the feat/ec-bind-interface branch July 16, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Ability to bind different app functions to separate interfaces

1 participant