跳到正文

Port Bridge

作者:did4510

PortBridge is a server-side utility mod that automatically makes your Minecraft server publicly joina

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

🌐 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:

  1. Detect your local server port
  2. Discover your public IP address
  3. Attempt to create a temporary port-forward mapping on your router (UPnP/NAT-PMP style logic)
  4. Verify the mapping
  5. 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

  • Optionally forward additional ports:
  • RCON
  • Query
  • Web maps
  • Fully configurable per port

🧠 Robust Diagnostics

  • /portbridge diag command shows:
  • Router / gateway info
  • WAN service type
  • Mapping status
  • Last error details
  • Helpful for debugging router compatibility

🧪 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

  • Fully customizable console + OP messages
  • Use placeholders like:
  • {PUBLIC_IP}
  • {PORT}
  • {PROTOCOL}
  • Example:
  🌍 Server is live!
  Join using: {PUBLIC_IP}:{PORT}

📜 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.

常见问题

Port Bridge 支持哪些 Minecraft 版本?

Port Bridge 支持 Minecraft Java 版 1.21.1–1.21.11,共 11 个版本,可用的加载器:Forge / NeoForge。下载时注意选择和你游戏版本一致的文件。

Port Bridge 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Forge / NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:仅服务端。

评论

登录后评论和评分