class_docstr: Manages interactions between agents on messenger as well as direct interactions
  between agents and the messenger overworld.
docstr: Set up socket to start communicating to workers.
docstr_tok: ["Set","up","socket","to","start","communicating","to","workers","."]
code: def setup_socket(self):
      """
      Set up socket to start communicating to workers.
      """
      if self.bypass_server_setup:
          return
  
      log_utils.print_and_log(
          logging.INFO,
          "Local: Setting up WebSocket...",
          should_print=True,
      )
  
      self.app_token = self.get_app_token()
      self.sender = MessageSender(self.app_token)
  
      # Set up receive
      socket_use_url = self.server_url
      if self.opt["local"]:  # skip some hops for local stuff
          socket_use_url = "https://localhost"
      self.socket = ChatServiceMessageSocket(
          socket_use_url, self.port, self._handle_webhook_event
      )
      log_utils.print_and_log(
          logging.INFO, "done with websocket", should_print=True
      )
  
imports: import logging
  import os
  from parlai.core.agents import create_agent
  import parlai.chat_service.utils.logging
  import parlai.chat_service.utils.server
  from parlai.utils.io import PathManager
  from parlai.chat_service.services.messenger.agents import MessengerAgent
  from parlai.chat_service.core.socket import ChatServiceMessageSocket
  from parlai.chat_service.services.messenger.message_sender import MessageSender
  from parlai.chat_service.core.chat_service_manager import ChatServiceManager
label_desc: Use image node_id 17 for calling the MessengerManager obj's underlying member method code with example usage: obj.setup_socket() without return types