ares-novacom: publish a host port on the device with --reverse - #17
Merged
mariotaku merged 1 commit intoAug 27, 2026
Merged
Conversation
--forward only carries connections one way. Add --reverse for the other: the device listens, and every connection it accepts is pumped to a port on this machine, so an app under development can reach a dev server on the host at localhost:<device port>. --port keeps its shape, device port first. Which end listens is what the direction flag decides. The device is asked to bind its own loopback rather than every interface, so a published port stays off the network the device sits on. libssh holds the session lock for the whole timeout a poll is given, so an accept loop that asks for it again straight away starves the threads pumping the connections already open. The first test carried an HTTP request to the host and logged a 200 there, but the reply never went back. The loop glances for 10ms and stands back for 40ms instead. `bridge` splits into the channel setup each direction needs and the `pump` they share. A session that has gone away usually leaves `TryAgain` behind as its last error, so the loop reports the loss without that meaningless suffix. Verified on a UP7560: content matches through a reverse forward, a 5MB transfer keeps its checksum, three concurrent downloads all match, and 5MB chained host -> --forward -> device -> --reverse -> host arrives intact in 5.2s. Also works against stock OpenSSH, not only a device. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gde2tcn5SbUHKhesuTNB7a
mariotaku
force-pushed
the
feat/novacom-reverse-forward
branch
from
August 27, 2026 04:50
6194de8 to
8c84316
Compare
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.
--forwardonly carries connections one way. This adds--reversefor the other: the device listens, and every connection it accepts is pumped to a port on this machine, so an app under development can reach a dev server on the host atlocalhost:<device port>.# TV apps/scripts reach the host's dev server at http://localhost:9977 ares-novacom -d tv --reverse --port 9977:18080--portkeeps its shape — device port first, host port second. Which end listens is what the direction flag decides. The device is asked to bind its own loopback rather than every interface, so a published port stays off the network the device sits on.The accept loop
libssh holds the session lock for the whole timeout a poll is given, so an accept loop that asks for it again straight away starves the threads pumping the connections already open. The first test carried an HTTP request to the host and logged a 200 there, but the reply never went back. The loop glances for 10 ms and stands back for 40 ms instead.
bridgesplits into the channel setup each direction needs and thepumpthey share. A session that has gone away usually leavesTryAgainbehind as its last error, so the loop reports the loss without that meaningless suffix.Verified on a UP7560
--forward→ device →--reverse→ host arrives intact in 5.2 sAlso works against stock OpenSSH, not only a device.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Gde2tcn5SbUHKhesuTNB7a