mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-04-16 18:49:16 -04:00
pass username to inbound.User.Email in http/socks server
This commit is contained in:
@@ -85,7 +85,8 @@ type readerOnly struct {
|
||||
}
|
||||
|
||||
func (s *Server) Process(ctx context.Context, network net.Network, conn internet.Connection, dispatcher routing.Dispatcher) error {
|
||||
if inbound := session.InboundFromContext(ctx); inbound != nil {
|
||||
inbound := session.InboundFromContext(ctx)
|
||||
if inbound != nil {
|
||||
inbound.User = &protocol.MemoryUser{
|
||||
Level: s.config.UserLevel,
|
||||
}
|
||||
@@ -112,6 +113,9 @@ Start:
|
||||
if !ok || !s.config.HasAccount(user, pass) {
|
||||
return common.Error2(conn.Write([]byte("HTTP/1.1 407 Proxy Authentication Required\r\nProxy-Authenticate: Basic realm=\"proxy\"\r\n\r\n")))
|
||||
}
|
||||
if inbound != nil {
|
||||
inbound.User.Email = user
|
||||
}
|
||||
}
|
||||
|
||||
newError("request to Method [", request.Method, "] Host [", request.Host, "] with URL [", request.URL, "]").WriteToLog(session.ExportIDToError(ctx))
|
||||
|
||||
Reference in New Issue
Block a user