Discussion about the possibility of adding PT support to V2Ray to serve the role of HTTPT
Adding Tor PT Support to V2Ray itself
The first option is to add PT support directly to V2Ray. In this way, the PT related code will be maintained directly by V2Fly. If a new protocol is added, it can be used as a PT automatically. It would be more difficult to add generalized PT support to V2Ray than add a Tor Specific PT support to HTTPT. However, if we can do that correctly, a significant amount of protocols(including future ones) can be supported at no additional cost.
Teaching PT protocol to V2Ray
Currently, V2Ray does not understands PT protocol. As per the V2Ray convention, the support for PT will be split into components and be made reusable. In order to add Tor PT protocol support, following Tor specific code will need to be supported in addition to general-purpose PT client support.
- ExtOR protocol
- Socks5-Tor protocol
- PT IPC(environment variable to option mapping)
Design interactions between Tor and V2Ray
Tor can only transfer 256 characters of information in client connection. However, a V2Ray full configuration file is about 2K - 50 KB long, so there is no way of transferring all the information necessary in the connection parameter itself. So we would need to transfer only the info needed.
Here are some of the candidates:
- Outbound name (Cannot customize connection detail)
- Config file name + Outbound name (Requires external file)
- Outbound Config JSON Content (complex config may be longer than 256 characters)
- Connection specification link(flat option to option config) (requires active maintenance to keep link and settings in sync)
If we just modify HTTPT to work with Tor, it can simply use a Connection specification link, like all other PTs.
Additional Optional Features lacking
- uTLS support is not currently in V2Ray
Adding Tor PT Support as a separate program
We can create a separate program that reuses V2Ray's code to create a PT like https://github.com/shadowsocks/v2ray-plugin.
It is easier to add Tor PT support if that part of the code does not need to be subject to ordinary quality control and architecture of V2Ray. It is worth noting that in this case, this program will require active maintenance. And this program will not be super beneficial parties other Tor communities, so the maintenance cost will not be shared by others.
Conflict of Interest
@shelikhoo volunteer as the organization representative of Project V(V2Fly) and maintainer of V2Ray outside day job.