Hi teor. Thank you for the detailed feedback on the Pluggable Transport 2.0, Draft 2 proposal.
Your email covers a number of topics, which I will attempt to address. I have grouped the issues you've raised into some different categories.
1. Issues inherited from the PT 1.0 specification - We tried not to make many large changes from PT 1.0 in order to preserve as much compatibility as possible. We would be happy to discuss making additional changes in the upcoming PT 2.1 specification process.
2. Feature requests to help serve the needs of Tor - Tor folks were certainly involved in the PT 2.0 specification process. Roger, Nick, and Yawning attended the meetings. However, I can see that there are some feature requests from you and Yawning that did not make it into the PT 2.0 specification. We would love to see these discussed as part of the PT 2.1 specification. I have already made a note to include them on the agenda for the Pluggable Transport Implementers Meeting, which is happening after TorDev. If you would like to participate in the specification process, that would be very helpful and ensure that these feature requests make it into the proposal and are specified in a way that meets your needs for Tor.
3. Requests for clarification - These have generally been incorporated into the latest draft, PT 2.0 draft 3. I will be sending this out shortly. I hope that you will find that the new draft addresses many of the areas that you found unclear in the previous draft.
4. Clarification of issues outside of the scope of the specification document - I will attempt to answer these below:
How will Tor implement the relevant interfaces?
The code changes to Tor are minimal. The authentication method uses to send per-connection arguments to transports has been changed in PT 2.0 to use a custom SOCKS authentication method instead of using the username and password authentication method. No other changes are required to Tor to use PT 2.0 transport providers. We have provided a patch to Tor to implement this functionality in a backwards-incompatible way, so both PT 1.0 and PT 2.0 providers can be used with the patch. We have also implemented a PT 2.0-compatible transport provider, which is available here:
Can you please map each environmental variable to the Go interface?
There is not a one-to-one mapping between the environment variables and the Go interface. There are two parts to the PT implementation. There is the proxy and there are the transports. The environment variables are for configuring the proxy, which includes the information necessary to configure the transports. The Go interface is for using the transports directly in your code, without a proxy process. Therefore, only a subset of the information specified for the environment variables is required when using the Go interface, and so a one-to-one mapping is not possible.
What is the UDP equivalent to PT Client Per-Connection Arguments?
There is no equivalent to PT Client Per-Connection Arguments for UDP. PT 1.0 supported only one proxy mode, SOCKS5. PT 2.0 supports multiple proxy modes, but only the SOCKS5 proxy mode supports PT Client Per-Connection Arguments. This is because it is the SOCKS5 protocol that provides the channel to supply PT Client Per-Connection Arguments (through the custom authentication method). You may be wondering, how do you use a transport that requires PT Client Per-Connection Arguments in a proxy mode other than SOCKS5 (for instance, UDP). You can set them when you start the PT client using the -options command line flag. Of course, in this scenario, they will not be "per connection" as they will be the same for every connection. However, this should work fine with the current PTs. If you truly need per-connection arguments, then you are limited to SOCKS5.
I hope that I have answered some of your questions. I will be at TorDev all week, so I would love to discuss some of the finer details with you at your convenience.
Also, I wanted to clear up one thing that was said later in this thread. The Go transports API is not based on the obfs4proxy internal API. The very first draft was based on the obfs4proxy code and everyone agreed that this was not ideal. The current Go API specified in PT 2.0 draft 3 is based on the Go net.Conn API. following the general principle set forth in the specification document to make the transport library look as much as possible like the native socket implementation for the language.