MantaProxy's static ports usually support Protocol Adaptation.
You don't need to switch in the background. When configuring in the software, directly select the protocol you want to use (HTTP or SOCKS5), fill in the same IP and port, and the server will automatically recognize it.