m := glowstone.NewMux()
//Tries to connect with the other mux on port 8000
if err := m.Dial(":8000"); err != nil {
log.Fatal(err.Error())
}
//When connection is successfull, we can start receiving packets
if err := m.Recv(); err != nil {
log.Fatal(err.Error())
}
m := glowstone.NewMux()
//Listens for other mux to connect,
if err := m.ListenMux(":8000"); err != nil {
log.Fatal(err.Error())
}
//Listens for other players to connect, after that it handles each connection and forwards it to your minecraft server
if err := m.Listen(":9000"); err != nil {
log.Fatal(err.Error())
}