code: func (rtm *RTM) startRTMAndDial(useRTMStart bool) (info *Info, _ *websocket.Conn, err error) {
  	var (
  		url string
  	)
  
  	if useRTMStart {
  		rtm.Debugf("Starting RTM")
  		info, url, err = rtm.StartRTM()
  	} else {
  		rtm.Debugf("Connecting to RTM")
  		info, url, err = rtm.ConnectRTM()
  	}
  	if err != nil {
  		rtm.Debugf("Failed to start or connect to RTM: %s", err)
  		return nil, nil, err
  	}
  
  	// install connection parameters
  	u, err := stdurl.Parse(url)
  	if err != nil {
  		return nil, nil, err
  	}
  	u.RawQuery = rtm.connParams.Encode()
  	url = u.String()
  
  	rtm.Debugf("Dialing to websocket on url %s", url)
  	// Only use HTTPS for connections to prevent MITM attacks on the connection.
  	upgradeHeader := http.Header{}
  	upgradeHeader.Add("Origin", "https://api.slack.com")
  	dialer := websocket.DefaultDialer
  	if rtm.dialer != nil {
  		dialer = rtm.dialer
  	}
  	conn, _, err := dialer.Dial(url, upgradeHeader)
  	if err != nil {
  		rtm.Debugf("Failed to dial to the websocket: %s", err)
  		return nil, nil, err
  	}
  	return info, conn, err
  }
docs: // startRTMAndDial attempts to connect to the slack websocket. If useRTMStart is true,
  // then it returns the  full information returned by the "rtm.start" method on the
  // slack API. Else it uses the "rtm.connect" method to connect