mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-01 00:16:26 +00:00
add email into access log for shadowsocks, vmess and mux
This commit is contained in:
@@ -18,6 +18,7 @@ type AccessMessage struct {
|
||||
To interface{}
|
||||
Status AccessStatus
|
||||
Reason interface{}
|
||||
Email string
|
||||
}
|
||||
|
||||
func (m *AccessMessage) String() string {
|
||||
@@ -29,5 +30,11 @@ func (m *AccessMessage) String() string {
|
||||
builder.WriteString(serial.ToString(m.To))
|
||||
builder.WriteByte(' ')
|
||||
builder.WriteString(serial.ToString(m.Reason))
|
||||
|
||||
if len(m.Email) > 0 {
|
||||
builder.WriteString("email:")
|
||||
builder.WriteString(m.Email)
|
||||
builder.WriteByte(' ')
|
||||
}
|
||||
return builder.String()
|
||||
}
|
||||
|
||||
@@ -118,6 +118,7 @@ func (w *ServerWorker) handleStatusNew(ctx context.Context, meta *FrameMetadata,
|
||||
}
|
||||
if inbound := session.InboundFromContext(ctx); inbound != nil && inbound.Source.IsValid() {
|
||||
msg.From = inbound.Source
|
||||
msg.Email = inbound.User.Email
|
||||
}
|
||||
log.Record(msg)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user