Skip to content

Commit

Permalink
Add direct connect by default
Browse files Browse the repository at this point in the history
Note: Proxy server is still required due to
LemmyNet/lemmy#3567
  • Loading branch information
aeharding committed Jul 24, 2023
1 parent 84b2776 commit 6c19300
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions src/services/lemmy.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
import { LemmyHttp } from "lemmy-js-client";
import { reduceFileSize } from "../helpers/imageCompress";

const UNPROXIED_LEMMY_SERVERS = [
"lemmy.ml",
"beehaw.org",
"sh.itjust.works",
"lemm.ee",
"feddit.de",
"midwest.social",
"lemmynsfw.com",
"lemmy.ca",
"lemmy.sdf.org",
"lemmy.world",
];

function buildBaseUrl(url: string): string {
if (UNPROXIED_LEMMY_SERVERS.includes(url)) {
return `https://${url}`;
}
return buildDirectConnectBaseUrl(url);
}

return buildProxiedBaseUrl(url);
function buildDirectConnectBaseUrl(url: string): string {
return `https://${url}`;
}

function buildProxiedBaseUrl(url: string): string {
Expand Down

0 comments on commit 6c19300

Please sign in to comment.