code: def proxy_to(self, peer: Any) -> Self:
      # relative
      from .domain_client import DomainClient
      from .enclave_client import EnclaveClient
  
      connection = self.connection.with_proxy(peer.id)
      metadata = connection.get_node_metadata(
          credentials=SyftSigningKey.generate()
      )
      if metadata.node_type == NodeType.DOMAIN.value:
          client_type = DomainClient
      elif metadata.node_type == NodeType.ENCLAVE.value:
          client_type = EnclaveClient
      else:
          raise SyftException(
              f"Unknown node type {metadata.node_type} to create proxy client"
          )
  
      client = client_type(
          connection=connection,
          credentials=self.credentials,
      )
      return client
  
imports: from typing import Any
  from typing import List
  from typing import Optional
  from typing import Union
  from typing_extensions import Self
  from ..abstract_node import NodeSideType
  from ..abstract_node import NodeType
  from ..img.base64 import base64read
  from ..node.credentials import SyftSigningKey
  from ..serde.serializable import serializable
  from ..service.network.node_peer import NodePeer
  from ..service.response import SyftError
  from ..service.response import SyftException
  from ..types.syft_object import SYFT_OBJECT_VERSION_1
  from ..types.syft_object import SyftObject
  from ..util.fonts import fonts_css
  from .client import SyftClient
label_desc: Use image node_id 1 for calling the GatewayClient obj's underlying member method code with example usage: obj.proxy_to(peer) and returns: client