func RunServer(bind string, p []*protocols.Protocol, logger zerolog.Logger) {
	logger = logger.With().Str("module", "listener").Logger()
	if len(p) == 0 {
		logger.Warn().Msg("No protocols defined.")
	} else {
		logger.Info().Msg("Protocol chain:")
		for _, proto := range p {
			logger.Info().Str("protocol", proto.Name).Str("target", proto.Target).Msgf("- %s @ %s", proto.Name, proto.Target)
		}
	}
	listener, err := net.Listen("tcp", bind)
	if err != nil {
		logger.Fatal().Str("bind", bind).Err(err).Msg("Unable to create listener.")
		os.Exit(1)
	}
	defer listener.Close()
	logger.Info().Str("bind", listener.Addr().String()).Msg("Listening...")
	for {
		conn, err := listener.Accept()
		if err != nil {
			logger.Debug().Err(err).Msg("Error while accepting connection.")
		}
		go ConnectionHandler(conn, p,
			logger.With().Str("module", "handler").Str("ip", conn.RemoteAddr().String()).Logger())
	}
}
RunServer runs protoplex
package protoplex
import (
	"bytes"
	"net"
	"os"
	"time"
	"github.com/rs/zerolog"
	"github.com/Pandentia/protoplex/protoplex/protocols"
)