To set up a reverse proxy for Janitor AI, follow these steps:
Step-by-Step Guide
-
Create a Janitor AI Account:
- Register on the Janitor AI website if you haven't already.
-
Access API Settings:
- Log in to your Janitor AI account.
- Click on any character you want to chat with and then click on "Chat."
- When prompted with "API not ready," click to set up the API.
-
Select OpenAI Model:
- Go to API settings by clicking on the three lines (menu) and then selecting "API Settings."
- Choose the OpenAI model you want to use (e.g., GPT-3.5 turbo).
-
Find a Reverse Proxy:
- Go to Google and search for "Janitor AI reverse proxy GitHub."
- Click on the first link and join the associated Discord server.
-
Join the Discord Server:
- Follow the instructions to join the Discord server.
- In the Discord server, navigate to the reverse proxy section and copy one of the provided reverse proxy URLs.
-
Generate a Proxy Key:
- In the Discord server, go to the bot section and type
/keyto generate a proxy key. - Copy the generated key.
- In the Discord server, go to the bot section and type
-
Configure Janitor AI:
- Go back to Janitor AI and paste the reverse proxy URL and the proxy key into the respective fields in the API settings.
- Save the settings.
-
Start Chatting:
- Once the settings are saved, you can start chatting with your selected character.
Example Configuration
Here is an example of how to configure the reverse proxy using Node.js and Express:
const express = require('express');
const httpProxy = require('http-proxy');
const app = express();
const apiProxy = httpProxy.createProxyServer();
const serverOne = 'http://localhost:3001';
const serverTwo = 'http://localhost:3002';
app.all("/app1/*", function(req, res) {
console.log('redirecting to Server1');
apiProxy.web(req, res, {target: serverOne});
});
app.all("/app2/*", function(req, res) {
console.log('redirecting to Server2');
apiProxy.web(req, res, {target: serverTwo});
});
app.listen(3000, () => {
console.log('Reverse proxy server is running on port 3000');
});
Replace serverOne and serverTwo with the actual URLs of your Janitor AI and OpenAI endpoints.
Additional Resources
- YouTube Tutorial on Setting Up Janitor AI Reverse Proxy
- GitHub Repository for Janitor AI Reverse Proxy
- Detailed Guide on Reverse Proxy for Janitor AI
By following these steps, you should be able to set up a reverse proxy for Janitor AI effectively.
Answered August 14 2024 by Toolify
