Surge includes several components.
Surge Proxy Server (Surge Core)
This is the core part of Surge. It's a full-function HTTP/SOCKS5 proxy server with high performance and stability, written in Objective-C and optimized for macOS and iOS.
Surge TUN (iOS Version Only)
Some apps do not obey system proxy settings (such as Mail.app), because they need to use a raw TCP socket. This kind of traffic is handled by Surge TUN.
Currently, Surge TUN can only process TCP and UDP protocol. Other protocol packets (such as ICMP) will be dropped. You can use 'bypass-tun' option as a workaround.
This is the architecture for Surge iOS:
Surge Dashboard (Mac Version Only)
Surge Dashboard is a graphical user interface to review and inspect requests, list DNS cache, and modify configurations. It can connect to a local Surge instance, or a remote instance when the external-controller-access is set.
Surge CLI (Mac Version Only)
Surge CLI is a command line tool to control Surge. It's bundled in mac version. Just like Surge Dashboard, it can connect to a local Surge instance, or a remote instance when the external-controller-access is set.