code: func targetEndpoint(task *task, port uint32, containerNet bool) string {
  
  	var host string
  
  	// Use the task's ipAddress field when it's in a container network
  	if containerNet && len(task.IPAddresses) > 0 {
  		host = task.IPAddresses[0].Address
  	} else {
  		host = task.Host
  	}
  
  	return net.JoinHostPort(host, fmt.Sprintf("%d", port))
  }
docs: // Generate a target endpoint string in host:port format.