<div dir="ltr">I'm kicking off this discussion on the mailing list as I don't have anything well-formed enough to take to the bug tracker, and I am hoping to get some more engagement on the matter.<div><br></div><div>Currently there is no way to explicitly compose Twisted endpoints, but several endpoint implementations have arisen that explicitly wrap another endpoint, and so have needed a way to do this. So far, this has been implementing by passing in an endpoint description, and then calling serverFromString/clientFromString internally in the endpoint to construct the wrapped endpoint. I've seen two different ways of encoding the "inner" endpoint:</div><div><br></div><div>1. Backslash escaping; for example:</div><div><br></div><div><span style="font-family:monospace;font-size:13px">tls:awesome.site.example.com:443:endpoint=tcp\:7.6.5.4\:443</span><br></div><div><br></div><div>This has the advantage that it is endlessly nestable, for example:</div><div><br></div><div><span style="font-family:monospace;font-size:13px">tls:internal.hostname.whatever:42:endpoint=tls\:<a href="http://awesome.site.example.com">awesome.site.example.com</a>\:443\:endpoint=tcp\\\:7.6.5.4\\\:443</span><br></div><div><br></div><div>It has the disadvantage that it is a bit tricky to read and write.</div><div><br></div><div>2. Splitting keyword and positional arguments; for example:</div><div><br></div><div><span style="font-family:monospace;font-size:13px">txsni:/srv/certs:tcp:443</span><br></div><div><br></div><div>This has the advantage that it is easier to read and write, but the disadvantage that it isn't nestable. It also starts to break down when you have a lot of parameters, as the positional syntax becomes much harder to read.</div><div><br></div><div>Neither of these solutions is entirely satisfactory; I initially followed approach 2 for txacme, but now that I need to add more parameters to the le:/lets: endpoints, it is starting to break down.</div><div><br></div><div>Cory suggested a third possibility; an explicit syntax for composing endpoints. In this model, the endpoint string parsing machinery would construct the different endpoints, and compose them together (presumably the API of the parsers would need to be extended a bit for this). For example:</div><div><br></div><div><div><span style="font-family:monospace;font-size:13px">tls:awesome.site.example.com:443->tcp:<a href="http://7.6.5.4:443">7.6.5.4:443</a></span></div><br class="inbox-inbox-Apple-interchange-newline"></div><div>A less whimsical syntax than "->" might be better; for example, semicolons, or something like that.</div></div>