Skip to content

Commit

Permalink
Move cors proxy to glitch (replit continues their rugpull 😔)
Browse files Browse the repository at this point in the history
See comment in code
  • Loading branch information
josephrocca authored Jan 5, 2024
1 parent 4e87673 commit 0098a23
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6841,7 +6841,8 @@ <h2 style="text-align:center;margin-bottom: 0.5rem;">Your Characters</h2>
// Just use 'fetch' as normal and this proxy will be used automatically.
// Note: I was originally trying a normal fetch and then only falling back to this CORS proxy if it failed, but the problem with that is that this would hit the endpoint twice, which may have side effects, and the user might not want that.
// I may eventually have to add manual "exemptions" to skip proxying certain URLs that don't need it - like huggingface models, for example, since we could start to become bandwidth limited.
const proxiedUrl = "https://opencharacters-cors-proxy.joe64.repl.co?url=" + encodeURIComponent(url);
// EDIT: Moved to Glitch since Replit raised prices to an absurd $6/month for a 0.25 vCPU machine in Jan 2024 (no more "Always On" machines - only "Deployments" now).
const proxiedUrl = "https://opencharacters-cors-proxy.glitch.me?url=" + encodeURIComponent(url);
try {
if(typeof argumentsList[0] === "object") {
argumentsList[0] = new Request(proxiedUrl, argumentsList[0]);
Expand Down

0 comments on commit 0098a23

Please sign in to comment.