? Port Bridge
适用于 Minecraft 服务器(Forge / NeoForge)的自动端口转发
Port Bridge 是一款服务端 Minecraft 模组,它利用路由器的端口转发逻辑自动将你的服务器暴露到互联网。
无需手动配置路由器,也无需处理 UPnP 的复杂性。只需启动服务器并分享加入地址即可。
该模组专为自建服务器、家庭网络以及希望朋友能轻松加入而无需处理网络麻烦的创作者设计。
✨ Port Bridge 的功能
当你的 Minecraft 服务器启动时,Port Bridge 会执行以下操作:
-
检测你的本地服务器端口
-
发现你的公网 IP 地址
-
尝试在路由器上创建临时端口转发映射(采用 UPnP/NAT-PMP 风格的逻辑)
-
验证映射是否成功
-
显示最终的公网加入地址:
当服务器停止运行时,Port Bridge 会清理端口映射,确保不会留下未使用的转发规则。
? 主要特性
? 自动端口映射
- 在启动时自动转发 Minecraft 服务器端口
- 无需手动登录路由器
- 完全在服务端运行
? 租期 / TTL 续订
- 后台任务会在端口映射过期前进行续订
- 防止在长时间服务器会话中突然断连
- 如果续订失败,会记录警告日志
? 关机时清理映射
- 服务器停止时移除端口转发
- 防止遗留或“卡住”的路由器规则
➕ 多端口支持
? 强大的诊断功能
-
/portbridge diag 命令可查看:
- 路由器/网关信息
- WAN 服务类型
- 映射状态
- 最后错误详情
-
有助于调试路由器兼容性问题
? 试运行模式
- 模拟端口转发而不实际更改路由器设置
- 非常适合测试和开发
- 通过
advanced.dryRun = true 启用
? 基于配置文件/世界的配置
- 不同的服务器配置文件或世界使用不同的端口规则
- 适用于多实例部署场景
? 网络安全控制
- 限制仅在特定的本地子网内进行端口转发尝试
- 防止在不安全的网络上意外暴露
? 自定义加入消息模板
? 示例控制台输出
[Port Bridge] 检测到服务器端口: 25565
[Port Bridge] 解析到的公网 IP: 103.xxx.xxx.xxx
[Port Bridge] 端口映射成功 (TCP)
[Port Bridge] 请分享此地址:
[Port Bridge] 103.xxx.xxx.xxx:25565
? 支持的加载器
- ✅ Forge (服务端)
- ✅ NeoForge (服务端)
- ❌ 不需要客户端侧安装
⚠️ 重要说明
- 路由器必须支持自动端口映射协议
- 某些 ISP 会阻止入站端口或使用 CGNAT
- 如果端口映射失败,该模组不会导致服务器崩溃
- 所有操作都会清晰记录日志以确保透明度
?️ 使用场景
- 从家中托管服务器
- 与朋友联机而无需手动进行端口转发
- 在动态 IP 连接下测试服务器
- 临时或短期运行的服务器
? 安全理念
Port Bridge:
- 仅在服务器运行时打开端口
- 在关闭时进行清理
- 绝不会暴露超出你配置范围的内容
- 通过配置文件和命令提供完全的控制权
? 模组名称
Port Bridge
将你的本地服务器与世界连接起来。
? Port Bridge
Automatic Port Forwarding for Minecraft Servers (Forge / NeoForge)
Port Bridge is a server-side Minecraft mod that automatically opens your server to the internet using router port forwarding logic.
No manual router configuration. No UPnP confusion. Just start the server and share the join address.
This mod is designed for self-hosted servers, home networks, and creators who want an easy way for friends to join without dealing with networking headaches.
✨ What Port Bridge Does
When your Minecraft server starts, Port Bridge will:
-
Detect your local server port
-
Discover your public IP address
-
Attempt to create a temporary port-forward mapping on your router (UPnP/NAT-PMP style logic)
-
Verify the mapping
-
Display the final public join address:
- In the server console
- As an OP broadcast message (configurable)
When the server stops, Port Bridge cleans up the port mapping so no unused forwards are left behind.
? Key Features
? Automatic Port Mapping
- Automatically forwards the Minecraft server port on startup
- No manual router login required
- Works entirely server-side
? Lease / TTL Renewal
- Background task renews port mappings before they expire
- Prevents sudden disconnects during long server sessions
- Logs warnings if renewal fails
? Clean Unmap on Shutdown
- Removes the port forward when the server stops
- Prevents leftover or “stuck” router rules
➕ Multiple Port Support
? Robust Diagnostics
? Dry-Run Mode
- Simulates port forwarding without actually changing router settings
- Perfect for testing and development
- Enable with
advanced.dryRun = true
? Profile / World-Based Configs
- Different port rules per server profile or world
- Useful for multi-instance setups
? Network Safety Controls
- Restrict port forwarding attempts to specific local subnets
- Prevents accidental exposure on unsafe networks
? Custom Join Message Templates
? Example Console Output
[Port Bridge] Server port detected: 25565
[Port Bridge] Public IP resolved: 103.xxx.xxx.xxx
[Port Bridge] Port mapping successful (TCP)
[Port Bridge] Share this address:
[Port Bridge] 103.xxx.xxx.xxx:25565
? Supported Loaders
- ✅ Forge (server)
- ✅ NeoForge (server)
- ❌ Client-side not required
⚠️ Important Notes
- Router must support automatic port mapping protocols
- Some ISPs block inbound ports or use CGNAT
- If port mapping fails, the mod will not crash the server
- All actions are logged clearly for transparency
?️ Use Cases
- Hosting a server from home
- Playing with friends without manual port forwarding
- Testing servers on dynamic IP connections
- Temporary or short-lived servers
? Security Philosophy
Port Bridge:
- Only opens ports while the server is running
- Cleans up on shutdown
- Never exposes more than what you configure
- Gives full control through config and commands
? Mod Name
Port Bridge
Bridging your local server to the world.
评论 0
登录后参与评分
还没有评论,来抢沙发吧