Skip to content

Commit

Permalink
fix(CLI): ip not showing in conns command
Browse files Browse the repository at this point in the history
  • Loading branch information
go-compile committed Aug 27, 2024
1 parent b85a09a commit f11b0ad
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
1 change: 0 additions & 1 deletion cmd/localrelay/ipcServer.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ func ipcRouteConns(ctx *fasthttp.RequestCtx) {
relays := runningRelaysCopy()
for _, r := range relays {
for _, conn := range r.GetConns() {

relayConns = append(relayConns, api.Connection{
LocalAddr: conn.Conn.LocalAddr().String(),
RemoteAddr: conn.Conn.RemoteAddr().String(),
Expand Down
2 changes: 1 addition & 1 deletion v2/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func (r *Relay) storeConn(conn net.Conn) {
r.m.Lock()
defer r.m.Unlock()

r.connPool = append(r.connPool, &PooledConn{conn, "", time.Now()})
r.connPool = append(r.connPool, &PooledConn{conn, "\x1b[92mdialing\x1b[0m", time.Now()})
}

// popConn removes the provided connection from the conn pool
Expand Down
3 changes: 1 addition & 2 deletions v2/relayfailovertcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ func dial(r *Relay, conn net.Conn, remoteAddress string, i int, network string,
return ErrFailConnect
}

// TODO: validate setConnRemote( is used correctly
r.setConnRemote(c, c.RemoteAddr())
r.setConnRemote(conn, c.RemoteAddr())

r.Metrics.dial(1, 0, start)

Expand Down
3 changes: 1 addition & 2 deletions v2/relaytcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ func handleConn(r *Relay, conn net.Conn, network string) {
continue
}

// TODO: test validate
r.setConnRemote(c, c.RemoteAddr())
r.setConnRemote(conn, c.RemoteAddr())

r.Metrics.dial(1, 0, start)

Expand Down

0 comments on commit f11b0ad

Please sign in to comment.