const innetExportUrl = import.meta.env.VITE_WS_INNET_EXPORT_API
const outnetExportUrl = import.meta.env.VITE_WS_OUTNET_EXPORT_API
const innetUrl = import.meta.env.VITE_WS_INNET_API
const outnetUrl = import.meta.env.VITE_WS_OUTNET_API
const hostIp = import.meta.env.VITE_HOST_IP;
export function getWsUrl() {
  var itemUrl = document.location.origin;
  console.log(itemUrl)
  if (itemUrl.includes(hostIp)) {
    return innetUrl;
  } else {
    return outnetUrl;
  }
}

export function getWsExportUrl() {
  var itemUrl = document.location.origin;
  if (itemUrl.includes(hostIp)) {
    return innetExportUrl;
  } else {
    return outnetExportUrl;
  }
}

export function patternNginxWsUrl() {
  var itemUrl = document.location.origin;
  // console.log(itemUrl)
  // if (itemUrl.includes(hostIp)) {
  //   return "ws://" + hostIp + "/ws/"
  // } else {
  //   return "ws://120.46.159.163/ws/"
  // }
  return itemUrl.replace('http', 'ws') + '/ws-sys/'
}

export function patternNginxExportWsUrl() {
  var itemUrl = document.location.origin;
  // console.log(itemUrl)
  // if (itemUrl.includes(hostIp)) {
  //   return "ws://" + hostIp + "/ws/"
  // } else {
  //   return "ws://120.46.159.163/ws/"
  // }
  return itemUrl.replace('http', 'ws') + '/ws-production/'
}