func Start(ip string, port int, cert string, key string, debug bool, t *Tracker, m *autocert.Manager, tor bool, limit *limiter.Limiter) (err error) {
	var listener net.Listener
	if debug {
		log.SetLevel(log.DebugLevel)
	}
	if tlsEnabled(cert, key, m) {
		listener, err = createTLSListener(ip, port, cert, key, m)
		if err != nil {
			return err
		}
	} else {
		listener, err = net.Listen("tcp", fmt.Sprintf("%s:%d", ip, port))
		if err != nil {
			return err
		}
	}
	defer listener.Close()
	packetInfoChan := make(chan *packetInfo)
	go startPacketInfoChan(packetInfoChan)
	torStr := ""
	if tor {
		torStr = "Tor"
	}
	log.Infof(logListener+"%sShuffle Listening on TCP %s:%d (pool size: %d)\n", torStr, ip, port, t.poolSize)
	for {
		conn, err := listener.Accept()
		if err != nil {
			continue
		}
		ip := getIP(conn)
		context, err := limit.Get(nil, ip)
		if err != nil {
			log.Debugf(logListener+"Unable to get connection limit: %s\n", err)
			conn.Close()
			continue
		}
		if context.Reached {
			log.Debugf(logListener+"Rate limit exceeded by %s\n", ip)
			conn.Close()
			continue
		}
		go handleConnection(conn, packetInfoChan, t)
	}
}
Start brings up the TCP server.
package server
import (
	"crypto/tls"
	"fmt"
	"net"
	"net/http"
	"time"
	"github.com/ulule/limiter/v3"
	"github.com/ulule/limiter/v3/drivers/middleware/stdlib"
	"golang.org/x/crypto/acme/autocert"
	"golang.org/x/net/websocket"
	log "github.com/sirupsen/logrus"
)
func init() {
	log.SetFormatter(&log.TextFormatter{
		ForceColors: true,  
	})
}