Open strazto opened 3 years ago
Fair point, @matthewstrasiotto. At first sight, I tend to agree with your suggested approach, of using the next available port in a range (with a reasonable default range), but I would like to think a bit more about it. And hopefully will get some time to look into it soon
I think a boolean flag -local
would be appropriate (e.g. -local=true
, -local=false
, true by default). I would prefer this over a port-range-only option, but I think a boolean flag and a port range would be appropriate too
tl;dr
It's annoying that running a new session of
tty-share
fails iflocalhost:8000
is unavable, eg anothertty-share
session is using it. (especially when you only care about the public session)It would be nice if the default was to bind to the first available port in a range, eg
localhost:8000-8010
. If8000
is taken, then the session binds tolocalhost:8001
etc.Details
It's great that
tty-share
's flexibility has been enhanced, but I find that a few new features detract from its vision as the "easy" non-astonishing method of sharing your terminal.One such feature is the local session feature. I find that this feature typically makes launching parallel sessions annoying, or launching sessions when localhost:8000 has been bound, for example, if I'm running a local dev server.
The solution is fairly simple, of course, just give it the
listen
arg-tty-share -listen localhost:8001
, but this step is still a step away fromtty-share
being the "easy mode" of session sharing.This could be resolved by either:
mosh
over which to iterate, & bind on, failing only if no port was available, ietty-share -listen localhost:8000-8010
.localhost:8000-8010
.localhost:8000-8010
vslocalhost:8000:8010
)mosh
uses8000:8010
syntax, but you also choose the bound address separately from the port, so it looks less weird because the colon only means one thing)csf
also uses thestart:end
convention, same note as above."localhost:8000-8010,8080,8888"
.To me, specifying a port range feels like the better option
A few caveats: