chisel icon indicating copy to clipboard operation
chisel copied to clipboard

Random opened port for local binding in case its not given

Open a-urth opened this issue 1 year ago • 2 comments

Current logic defaults local port to remote one in case former is not given. Maybe it makes sense to use any opened port for local port on a server side at least for reversed connections? Otherwise there is no way for client to determine which port to use for local binding on a server in case there is a lot of connections and ports might be already used on a server while they are free on a client.

a-urth avatar Jun 29 '23 09:06 a-urth

Say it chose a random port and you did: chisel client myserver.com 4000 5000

How would you know what got bound to what?

On Thu, 29 Jun 2023 at 7:25 pm Andrii Ursulenko @.***> wrote:

Current logic defaults local port to remote one in case former is not given. Maybe it makes sense to use any opened port for local port on a server side at least for reversed connections? Otherwise there is no way for client to determine which port to use for local binding on a server in case there is a lot of connections and ports might be already used on a server while they are free on a client.

— Reply to this email directly, view it on GitHub https://github.com/jpillora/chisel/issues/434, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE2X45BHRO3L72LCDFNQPLXNVCXZANCNFSM6AAAAAAZYHWXAA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

jpillora avatar Jun 29 '23 09:06 jpillora

Maybe my use case is too specific, but for reversed connections from a client standpoint why would i care what bound to what? And on a server there is multiple of ways to determine which port from which client is bound to what.

On the other hand it might be optional. If for local keyword random is used, then server will choose bind port on random. Kind like stdio is used for specific use case.

a-urth avatar Jun 29 '23 09:06 a-urth