xmccln
MCP Serverxmcclnpublic

mcproxy

一个用Go语言编写的高性能Minecraft代理服务器,支持基于域名的路由转发功能。

Repository Info

0
Stars
0
Forks
0
Watchers
0
Issues
Go
Language
-
License

About This Server

一个用Go语言编写的高性能Minecraft代理服务器,支持基于域名的路由转发功能。

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

MCProxy - Minecraft 代理服务器

一个用Go语言编写的高性能Minecraft代理服务器,支持基于域名的路由转发功能。

🚀 功能特性

  • 智能路由: 根据客户端连接的域名自动转发到不同的Minecraft服务器
  • 配置热重载: 支持配置文件实时监听和热重载,无需重启服务
  • 高性能: 使用Go语言编写,支持高并发连接
  • 简单配置: 通过YAML配置文件轻松管理路由规则
  • 默认路由: 支持设置默认目标服务器,处理未匹配的域名
  • 连接管理: 智能处理连接关闭和错误恢复

📋 系统要求

  • Go 1.21.0 或更高版本
  • 支持的操作系统: Windows, Linux, macOS

🛠️ 安装与使用

1. 克隆项目

git clone https://github.com/xmccln/mcproxy.git
cd mcproxy

2. 安装依赖

go mod tidy

3. 配置文件

编辑 config/config.yaml 文件:

# 监听端口
listen_port: 25570

# 默认目标服务器(当域名不匹配任何路由时使用)
default_target: "mc.example.com:25565"

# 域名路由映射
routes:
  "localhost": "127.0.0.1:25565"
  "test.example.com": "mc.example.com:25565"
  "survival.myserver.com": "192.168.1.100:25565"
  "creative.myserver.com": "192.168.1.101:25565"

4. 运行服务器

go run main.go

或者编译后运行:

go build -o mcproxy.exe
./mcproxy.exe

⚙️ 配置说明

配置文件结构

参数类型默认值说明
listen_portint25570代理服务器监听端口
default_targetstring"mc.example.com:25565"默认目标服务器地址
routesmap-域名到服务器的映射关系

路由配置

routes 部分,你可以配置域名到Minecraft服务器的映射:

routes:
  "域名": "目标服务器:端口"
  "creative.myserver.com": "192.168.1.100:25565"
  "survival.myserver.com": "192.168.1.101:25565"

🎮 使用示例

场景1: 多服务器管理

如果你有多个Minecraft服务器(如生存、创造、小游戏等),可以通过不同域名访问:

routes:
  "survival.myserver.com": "192.168.1.100:25565"
  "creative.myserver.com": "192.168.1.101:25565"
  "minigames.myserver.com": "192.168.1.102:25565"

场景2: 开发环境

在开发环境中,可以轻松在本地和远程服务器之间切换:

routes:
  "localhost": "127.0.0.1:25565"
  "dev.myserver.com": "dev-server.example.com:25565"
  "prod.myserver.com": "prod-server.example.com:25565"

🔧 工作原理

  1. 连接监听: 代理服务器监听指定端口的传入连接
  2. 握手解析: 解析Minecraft客户端的握手包,提取目标服务器域名
  3. 路由匹配: 根据域名查找对应的目标服务器
  4. 数据转发: 建立到目标服务器的连接,双向转发所有数据包
  5. 连接管理: 处理连接关闭和错误情况

📝 日志输出

运行时会显示详细的日志信息:

TCP服务器已启动,监听端口: 25570
使用配置文件: d:\poject\Go\mcproxy\config\config.yaml
客户端请求连接到: survival.myserver.com
找到域名映射: survival.myserver.com -> 192.168.1.100:25565
已连接到目标服务器: 192.168.1.100:25565

🛡️ 注意事项

  • 确保目标Minecraft服务器正常运行且可访问
  • 防火墙需要允许代理服务器的监听端口
  • 建议在生产环境中使用进程管理工具(如systemd、PM2等)
  • 配置文件修改后会自动重载,无需重启服务

🤝 依赖项

  • github.com/fatedier/golib - 网络工具库
  • github.com/fsnotify/fsnotify - 文件监听
  • github.com/spf13/viper - 配置管理

📄 许可证

MIT

🐛 问题反馈

如果遇到问题或有改进建议,请创建Issue或Pull Request。


注意: 这是一个Minecraft服务器代理工具,请确保遵守相关服务条款和法律法规。

Quick Start

1

Clone the repository

git clone https://github.com/xmccln/mcproxy
2

Install dependencies

cd mcproxy
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownerxmccln
Repomcproxy
LanguageGo
License-
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation