1
0
Fork 0
forked from External/ergo

switch CEF listener for docker support

This commit is contained in:
CEF Server 2024-07-27 23:50:11 +00:00
parent 60172a0be4
commit 979188cf2a

View file

@ -10,7 +10,7 @@ import (
"strings" "strings"
) )
const PORT = "127.0.0.1:22843" const LISTEN = "0.0.0.0:22843"
type CefConnection struct { type CefConnection struct {
connections map[string]net.Conn connections map[string]net.Conn
@ -33,12 +33,12 @@ func (instance *CefConnection) KickBroadcast(channel string, user string) {
func cefConnection(server *Server) *CefConnection { func cefConnection(server *Server) *CefConnection {
// create a tcp listener on the given port // create a tcp listener on the given port
listener, err := net.Listen("tcp", PORT) listener, err := net.Listen("tcp", LISTEN)
if err != nil { if err != nil {
fmt.Println("Unable to open CefConnection listener:", err) fmt.Println("Unable to open CefConnection listener:", err)
os.Exit(1) os.Exit(1)
} }
fmt.Printf("CefConnection listener on %s active\n", PORT) fmt.Printf("CefConnection listener on %s active\n", LISTEN)
instance := CefConnection{connections: make(map[string]net.Conn), server: server} instance := CefConnection{connections: make(map[string]net.Conn), server: server}
go cefListener(listener, &instance) go cefListener(listener, &instance)