1
0
Fork 0
forked from External/grumble

allow env to be passed

This commit is contained in:
Failure 2024-07-26 06:01:07 -07:00
parent 384ae29dd8
commit 1b4601a9c5

View file

@ -163,10 +163,14 @@ func (server *Server) ergoStateBroadcast(client *Client) {
}
func (server *Server) ergoConnection() {
conn, _ := net.Dial("tcp", "127.0.0.1:22843")
address := os.Getenv("GRUMBLE_ERGO_ADDR")
if len(address) == 0 {
address = "localhost"
}
conn, _ := net.Dial("tcp", net.JoinHostPort(address, "22843"))
server.ergo = conn
reader := bufio.NewReader(conn)
println("Connection established with ergo")
println("Connection established with ergo at ", address)
for {
// read client request data
data, err := reader.ReadBytes(byte('\n'))