]> Untitled Git - lemmy-ui.git/blobdiff - src/shared/env.ts
Use http client (#1081)
[lemmy-ui.git] / src / shared / env.ts
index ee61f086ff03e47c21fd85afb849e203c65fa817..576c6c58e916f9d9274bd40200555a9892a8b19c 100644 (file)
@@ -34,12 +34,6 @@ function getHost() {
   return isBrowser() ? getExternalHost() : getInternalHost();
 }
 
-function getWsHost() {
-  return isBrowser()
-    ? window.lemmyConfig?.wsHost ?? getHost()
-    : process.env.LEMMY_UI_LEMMY_WS_HOST ?? getExternalHost();
-}
-
 function getBaseLocal(s = "") {
   return `http${s}://${getHost()}`;
 }
@@ -47,18 +41,20 @@ function getBaseLocal(s = "") {
 export function getHttpBaseInternal() {
   return getBaseLocal(); // Don't use secure here
 }
+
+export function getHttpBaseExternal() {
+  return `http${getSecure()}://${getExternalHost()}`;
+}
+
 export function getHttpBase() {
   return getBaseLocal(getSecure());
 }
-export function getWsUri() {
-  return `ws${getSecure()}://${getWsHost()}/api/v3/ws`;
-}
+
 export function isHttps() {
   return getSecure() === "s";
 }
 
 console.log(`httpbase: ${getHttpBase()}`);
-console.log(`wsUri: ${getWsUri()}`);
 console.log(`isHttps: ${isHttps()}`);
 
 // This is for html tags, don't include port