|
@@ -4,9 +4,9 @@ export default function getOrigin(suffix: string = '', type: string = 'http') {
|
|
return `wss://${import.meta.env.VITE_SERVER_HOSTNAME}${suffix}`
|
|
return `wss://${import.meta.env.VITE_SERVER_HOSTNAME}${suffix}`
|
|
} else if (!import.meta.env.VITE_SERVER_PROTOCOL) {
|
|
} else if (!import.meta.env.VITE_SERVER_PROTOCOL) {
|
|
if (window.location.protocol === 'https:') {
|
|
if (window.location.protocol === 'https:') {
|
|
- return `wss://${window.location.hostname}${suffix}`
|
|
|
|
|
|
+ return `wss://${window.location.host}${suffix}`
|
|
} else {
|
|
} else {
|
|
- return `ws://${window.location.hostname}${suffix}`
|
|
|
|
|
|
+ return `ws://${window.location.host}${suffix}`
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return `ws://${import.meta.env.VITE_SERVER_HOSTNAME}${suffix}`
|
|
return `ws://${import.meta.env.VITE_SERVER_HOSTNAME}${suffix}`
|
|
@@ -15,6 +15,6 @@ export default function getOrigin(suffix: string = '', type: string = 'http') {
|
|
if (import.meta.env.VITE_SERVER_HOSTNAME) {
|
|
if (import.meta.env.VITE_SERVER_HOSTNAME) {
|
|
return `${import.meta.env.VITE_SERVER_PROTOCOL}//${import.meta.env.VITE_SERVER_HOSTNAME}${suffix}`
|
|
return `${import.meta.env.VITE_SERVER_PROTOCOL}//${import.meta.env.VITE_SERVER_HOSTNAME}${suffix}`
|
|
} else {
|
|
} else {
|
|
- return `${window.location.protocol}//${window.location.hostname}${suffix}`
|
|
|
|
|
|
+ return `${window.location.protocol}//${window.location.host}${suffix}`
|
|
}
|
|
}
|
|
}
|
|
}
|