Opened 3 years ago

Last modified 8 months ago

#4927 enhancement new

twisted.tap.portforward should use string endpoints for listen and destination addresses

Reported by: exarkun Owned by: tpratt
Priority: normal Milestone:
Component: core Keywords:
Cc: tobias.oberstein@… Branch:
Author: tpratt Launchpad Bug:

Description

Currently the portforward options are somewhat confusing. There are three of them, two for ports and one for a host. After a little puzzling, it's possible to figure out that host and dest_port define a remote TCP server to forward connections to, while port is a strport description of an address to listen on.

The current naming scheme mixes local with remote making it harder to figure out how to use the tool. But it also limits the forward destination to TCP addresses. It would be great to use endpoints to allow any sort of remote address to be specified. As well, it would be good to update the use of strports to endpoints for the local listening address.

This would be an excellent, simple showcase of the features you get with endpoints.

Attachments (3)

ticket-4927.patch (4.7 KB) - added by tpratt 3 years ago.
ticket-4927.2.patch (5.7 KB) - added by tpratt 3 years ago.
ticket-4927.3.patch (5.4 KB) - added by tpratt 3 years ago.
fix docstring, probably shouldn't t.python.deprecate in this case.

Download all attachments as: .zip

Change History (7)

Changed 3 years ago by tpratt

comment:1 Changed 3 years ago by tpratt

  • Author set to tpratt
  • Keywords review added

Changed 3 years ago by tpratt

Changed 3 years ago by tpratt

fix docstring, probably shouldn't t.python.deprecate in this case.

comment:2 Changed 3 years ago by thijs

All new public methods, classes and modules need an @since: 11.0 marker.

comment:3 Changed 3 years ago by moshez

  • Keywords review removed
  • Owner set to tpratt

It is better to put the -p/-h/-d ==> newer stuff code inside the option parsing (after "if selfconnect? is None") line: create selflisten? and selfconnect?. This way, when deleting old bw stuff, only one place needs to be touched.

Also, address thijs's comments :)

comment:4 Changed 8 months ago by oberstet

  • Cc tobias.oberstein@… added
Note: See TracTickets for help on using tickets.