<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def setup_xray_client(self, ip, port, client):
 """ Setup the xray client based on ip and port. If a preset client is specified, ip and port will be ignored. """

        if not client:
            client = self._create_xray_client(ip, port)
        self._xray_client = client