summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/frontend/src/config.ts4
-rw-r--r--packages/frontend/src/stream.ts4
2 files changed, 4 insertions, 4 deletions
diff --git a/packages/frontend/src/config.ts b/packages/frontend/src/config.ts
index 9de29e80df..2968ab12e6 100644
--- a/packages/frontend/src/config.ts
+++ b/packages/frontend/src/config.ts
@@ -11,8 +11,8 @@ const siteName = document.querySelector<HTMLMetaElement>('meta[property="og:site
export const host = address.host;
export const hostname = address.hostname;
export const url = address.origin;
-export const apiUrl = url + '/api';
-export const wsUrl = url.replace('http://', 'ws://').replace('https://', 'wss://') + '/streaming';
+export const apiUrl = location.origin + '/api';
+export const wsOrigin = location.origin;
export const lang = miLocalStorage.getItem('lang') ?? 'en-US';
export const langs = _LANGS_;
const preParseLocale = miLocalStorage.getItem('locale');
diff --git a/packages/frontend/src/stream.ts b/packages/frontend/src/stream.ts
index 27fce4d4b8..5f0826b4e3 100644
--- a/packages/frontend/src/stream.ts
+++ b/packages/frontend/src/stream.ts
@@ -6,14 +6,14 @@
import * as Misskey from 'misskey-js';
import { markRaw } from 'vue';
import { $i } from '@/account.js';
-import { url } from '@/config.js';
+import { wsOrigin } from '@/config.js';
let stream: Misskey.Stream | null = null;
export function useStream(): Misskey.Stream {
if (stream) return stream;
- stream = markRaw(new Misskey.Stream(url, $i ? {
+ stream = markRaw(new Misskey.Stream(wsOrigin, $i ? {
token: $i.token,
} : null));