mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 17:38:41 +00:00
Add shadowsocks 2022 multi-user inbound
This commit is contained in:
parent
b6391cbbe1
commit
cf7e675c45
6 changed files with 427 additions and 50 deletions
|
@ -30,6 +30,7 @@ func init() {
|
|||
type Inbound struct {
|
||||
networks []net.Network
|
||||
service shadowsocks.Service
|
||||
email string
|
||||
}
|
||||
|
||||
func NewServer(ctx context.Context, config *ServerConfig) (*Inbound, error) {
|
||||
|
@ -42,6 +43,7 @@ func NewServer(ctx context.Context, config *ServerConfig) (*Inbound, error) {
|
|||
}
|
||||
inbound := &Inbound{
|
||||
networks: networks,
|
||||
email: config.Email,
|
||||
}
|
||||
if !C.Contains(shadowaead_2022.List, config.Method) {
|
||||
return nil, newError("unsupported method ", config.Method)
|
||||
|
@ -103,6 +105,7 @@ func (i *Inbound) NewConnection(ctx context.Context, conn net.Conn, metadata M.M
|
|||
From: metadata.Source,
|
||||
To: metadata.Destination,
|
||||
Status: log.AccessAccepted,
|
||||
Email: i.email,
|
||||
})
|
||||
newError("tunnelling request to tcp:", metadata.Destination).WriteToLog(session.ExportIDToError(ctx))
|
||||
dispatcher := session.DispatcherFromContext(ctx)
|
||||
|
@ -123,6 +126,7 @@ func (i *Inbound) NewPacketConnection(ctx context.Context, conn N.PacketConn, me
|
|||
From: metadata.Source,
|
||||
To: metadata.Destination,
|
||||
Status: log.AccessAccepted,
|
||||
Email: i.email,
|
||||
})
|
||||
newError("tunnelling request to udp:", metadata.Destination).WriteToLog(session.ExportIDToError(ctx))
|
||||
dispatcher := session.DispatcherFromContext(ctx)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue