Move protocol-specific functionality of `server` into `protocol_handler`.