compute addresses

This commit is contained in:
Zack Scholl 2018-07-01 11:18:42 -07:00
parent 43026b9c2e
commit 816c25b05b
2 changed files with 2 additions and 3 deletions

View File

@ -67,7 +67,7 @@ func main() {
}, },
} }
app.Flags = []cli.Flag{ app.Flags = []cli.Flag{
cli.StringFlag{Name: "relay", Value: "wss://croc3.schollz.com"}, cli.StringFlag{Name: "relay", Value: "ws://croc3.schollz.com"},
cli.StringFlag{Name: "code, c", Usage: "codephrase used to connect to relay"}, cli.StringFlag{Name: "code, c", Usage: "codephrase used to connect to relay"},
cli.BoolFlag{Name: "local", Usage: "use only local mode"}, cli.BoolFlag{Name: "local", Usage: "use only local mode"},
cli.BoolFlag{Name: "debug", Usage: "increase verbosity (a lot)"}, cli.BoolFlag{Name: "debug", Usage: "increase verbosity (a lot)"},

View File

@ -150,8 +150,7 @@ func (c *Croc) joinChannel(ws *websocket.Conn, cd channelData) (channel string,
} }
c.rs.channel[cd.Channel].websocketConn[cd.Role] = ws c.rs.channel[cd.Channel].websocketConn[cd.Role] = ws
// assign the name // assign the name
c.rs.channel[cd.Channel].Addresses[cd.Role] = ws.RemoteAddr().String() c.rs.channel[cd.Channel].Addresses[cd.Role] = ws.RemoteAddr().Network()
log.Debugf("assigned role %d in channel '%s'", cd.Role, cd.Channel) log.Debugf("assigned role %d in channel '%s'", cd.Role, cd.Channel)
return return
} }