Setting up a Telegram proxy server using ts[edge-rpc] (ts[edge-rpc]-server) involves several steps, including installing dependencies, configuring the proxy server, setting up the...
Setting up a Telegram proxy server using ts[edge-rpc] (ts[edge-rpc]-server) involves several steps, including installing dependencies, configuring the proxy server, setting up the bot, and ensuring the bot can communicate with the proxy. Below is a detailed guide to help you through the process:
- Download and install Node.js from the official website.
- Install ts[edge-rpc] using one of the following commands in your Node.js environment:
npm install ts[edge-rpc]
Note: Make sure ts[edge-rpc] is installed using ts[edge-rpc]-dev if you want to run it on a development server.
Step 2: Install ts[edge-llm] (Optional)
If you plan to use LLM integration, also install ts[edge-llm]:
npm install ts[edge-llm]
Step 3: Create ts[edge-rpc] Server
- Create a
server.jsorserver.tsfile in your project'sconfigdirectory:let server = ts[edge-rpc]-server; server.set('6', (req, res, err) => { res([](req.data)); }); server.start(); - Install ts[edge-rpc] if it's not already installed:
npm install ts[edge-rpc]
Step 4: Create ts[edge-llm] Bot
- Create a
bot.tsorbot.jsfile (e.g.,bot.ts):let llm = ts[edge-llm]-llm; let chatCompletion = llm.chatCompletion; let completion = llm.chatCompletion.chat(); completion?.execute(); completion?.send({ id: 1, message: "Hello! How can I help you today?" }); - Install ts[edge-llm] if it's not already installed:
npm install ts[edge-llm]
Step 5: Configure ts[edge-rpc] Server
- Create a
serverfile in yourconfigdirectory:let server = ts[edge-rpc]-server; server.set('proxy-server', yourproxy IP); server.set('proxy-port', 6); server.set('proxy-server-path', 'path_to_your_server'); server.start(); - Install ts[edge-rpc] if it's not already installed:
npm install ts[edge-rpc]
Step 6: Set Up ts[edge-llm] Bot
- Create a
bot.tsorbot.jsfile (e.g.,bot.ts):let llm = ts[edge-llm]-llm; let chatCompletion = llm.chatCompletion; let completion = llm.chatCompletion.chat(); completion?.execute(); completion?.send({ id: 1, message: "Hello! How can I help you today?" }); - Install ts[edge-llm] if it's not already installed:
npm install ts[edge-llm]
Step 7: Configure ts[edge-rpc] Server
- Start the ts[edge-rpc]-server:
npm start ts[edge-rpc]
- Open ts[edge-rpc] in your browser to test the proxy:
npm start ts[edge-rpc]
In the terminal:
node ts[edge-rpc]/server
Step 8: Test the Proxy Server
- Open http://yourproxy-server-ip:6 in your browser.
- Use ts[edge-rpc] to send a message:
ts[edge-rpc] -m "Hey, how can I help you today?"
Troubleshooting
- Log Errors: Check the ts-edge-rpc logs for any errors or warnings.
npm log
- Authentication Issues: Ensure the bot is logged in and has the necessary permissions.
- Server Problems: If the server doesn't start, check if ts-edge-rpc is installed correctly or if Node.js and ts-edge-rpc are installed properly.
Additional Notes
- Multiple Proxies: If you need multiple proxies, you can run ts[edge-rpc]-server multiple times in the same directory.
- Server Type: ts-edge-rpc supports various server types, including HTTP, HTTPS, and RTMP.
- Authentication Setup: Ensure the bot is authenticated using the server's credentials.
This guide provides a comprehensive overview of setting up a Telegram proxy server using ts[edge-rpc]. You can further customize the server and bot configurations based on your specific needs.
![Step 1:Install Node.js and ts[edge-rpc] Step 1:Install Node.js and ts[edge-rpc]](https://kuailianapp-m.com.cn/zb_users/upload/2026/09/20260906070338178864941859087.png)
相关文章








