// Client-side configuration

// In dev, the React app runs on 3001 and the server on 3000 — use explicit port.
// In production (Docker), everything is served from the same origin — use window.location.host.
export function getWsUrl() {
  const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
  if (process.env.NODE_ENV === 'development') {
    return `${protocol}//${window.location.hostname}:3000`;
  }
  return `${protocol}//${window.location.host}`;
}
