forked from External/grumble
allow env to be passed
This commit is contained in:
parent
384ae29dd8
commit
1b4601a9c5
1 changed files with 6 additions and 2 deletions
|
|
@ -163,10 +163,14 @@ func (server *Server) ergoStateBroadcast(client *Client) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (server *Server) ergoConnection() {
|
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
|
server.ergo = conn
|
||||||
reader := bufio.NewReader(conn)
|
reader := bufio.NewReader(conn)
|
||||||
println("Connection established with ergo")
|
println("Connection established with ergo at ", address)
|
||||||
for {
|
for {
|
||||||
// read client request data
|
// read client request data
|
||||||
data, err := reader.ReadBytes(byte('\n'))
|
data, err := reader.ReadBytes(byte('\n'))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue