Skip to main content

Welcome to Gophertunnel

Gophertunnel is a powerful Go library for building Minecraft Bedrock Edition network tools, servers, and clients. Whether you’re creating proxies, custom servers, or network analysis tools, Gophertunnel provides the building blocks you need.

What is Gophertunnel?

Gophertunnel is composed of several packages that handle the complexities of Minecraft Bedrock Edition networking:
  • Protocol handling: Full implementation of the Bedrock Edition protocol
  • Authentication: Built-in Xbox Live and Microsoft authentication
  • Server creation: Listen for and accept player connections
  • Client connections: Connect to remote servers as a client
  • Packet manipulation: Read, write, and modify network packets
As of version v1.47.5, Gophertunnel requires at least Go 1.24.

Key Features

Client Connections

Connect to Minecraft servers, read packets, and send commands programmatically

Server Creation

Create custom Minecraft servers with full control over game logic and packet handling

Xbox Live Auth

Built-in authentication with Xbox Live and Microsoft accounts

Full Protocol Support

Complete implementation of Minecraft Bedrock Edition protocol with packet-level access

Use Cases

Gophertunnel is perfect for:
  • MITM Proxies: Forward and analyze traffic between clients and servers
  • Custom Servers: Build servers with custom game modes and mechanics
  • Network Analysis: Monitor and log Minecraft network traffic
  • Automation Tools: Create bots that interact with Minecraft servers
  • Server Testing: Automated testing of server implementations

Quick Example

Here’s a glimpse of how simple it is to connect to a Minecraft server:
package main

import (
    "github.com/sandertv/gophertunnel/minecraft"
    "github.com/sandertv/gophertunnel/minecraft/auth"
)

func main() {
    dialer := minecraft.Dialer{
        TokenSource: auth.TokenSource,
    }
    conn, err := dialer.Dial("raknet", "mco.mineplex.com:19132")
    if err != nil {
        panic(err)
    }
    defer conn.Close()
    
    // You're connected!
    if err := conn.DoSpawn(); err != nil {
        panic(err)
    }
}

Next Steps

Installation

Set up Gophertunnel in your Go project

Quick Start

Build your first Minecraft client or server
We do not under any circumstance support or endorse the usage of Gophertunnel with malicious intent.