Trojan listens on a TLS socket like a normal HTTPS service.
After TLS completes, the server inspects the first application data packet.
If the packet is not a valid Trojan request (wrong structure or password), the server treats it as “other protocols” and forwards the decrypted TLS stream to a preset endpoint (default 127.0.0.1:80).
The preset endpoint then controls the response, keeping the behavior indistinguishable from a real HTTPS site.