add server.address

addon-dailer
lqqyt2423 3 years ago
parent 2e0c62a08b
commit 1b26b43670

@ -63,11 +63,11 @@ func (addon *Log) ClientDisconnected(client *connection.Client) {
}
func (addon *Log) ServerConnected(connCtx *flow.ConnContext) {
log.Infof("%v server connect %v\n", connCtx.Client.Conn.RemoteAddr(), connCtx.Server.Conn.RemoteAddr())
log.Infof("%v server connect %v (%v)\n", connCtx.Client.Conn.RemoteAddr(), connCtx.Server.Address, connCtx.Server.Conn.RemoteAddr())
}
func (addon *Log) ServerDisconnected(connCtx *flow.ConnContext) {
log.Infof("%v server disconnect %v\n", connCtx.Client.Conn.RemoteAddr(), connCtx.Server.Conn.RemoteAddr())
log.Infof("%v server disconnect %v (%v)\n", connCtx.Client.Conn.RemoteAddr(), connCtx.Server.Address, connCtx.Server.Conn.RemoteAddr())
}
func (addon *Log) Requestheaders(f *flow.Flow) {

@ -22,9 +22,10 @@ func NewClient(c net.Conn) *Client {
}
type Server struct {
Id uuid.UUID
Conn net.Conn
Client *http.Client
Id uuid.UUID
Conn net.Conn
Client *http.Client
Address string
}
func NewServer() *Server {

@ -48,6 +48,7 @@ func (connCtx *ConnContext) InitHttpServer(sslInsecure bool, connWrap func(net.C
cw := connWrap(c)
server.Conn = cw
server.Address = addr
defer whenConnected()
return cw, nil
},
@ -90,6 +91,7 @@ func (connCtx *ConnContext) InitHttpsServer(sslInsecure bool, connWrap func(net.
cw := connWrap(plainConn)
server.Conn = cw
server.Address = addr
whenConnected()
firstTLSHost, _, err := net.SplitHostPort(addr)

Loading…
Cancel
Save