mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-07-25 08:38:14 +03:00
Add ssm api server
This commit is contained in:
@@ -18,8 +18,9 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
_ adapter.Inbound = (*ShadowsocksRelay)(nil)
|
||||
_ adapter.InjectableInbound = (*ShadowsocksRelay)(nil)
|
||||
_ adapter.Inbound = (*ShadowsocksRelay)(nil)
|
||||
_ adapter.InjectableInbound = (*ShadowsocksRelay)(nil)
|
||||
_ adapter.ManagedShadowsocksServer = (*ShadowsocksRelay)(nil)
|
||||
)
|
||||
|
||||
type ShadowsocksRelay struct {
|
||||
@@ -71,6 +72,18 @@ func newShadowsocksRelay(ctx context.Context, router adapter.Router, logger log.
|
||||
return inbound, err
|
||||
}
|
||||
|
||||
func (h *ShadowsocksRelay) Method() string {
|
||||
return h.service.Name()
|
||||
}
|
||||
|
||||
func (h *ShadowsocksRelay) Password() string {
|
||||
return h.service.Password()
|
||||
}
|
||||
|
||||
func (h *ShadowsocksRelay) UpdateUsers(users []string, uPSKs []string) error {
|
||||
return os.ErrInvalid
|
||||
}
|
||||
|
||||
func (h *ShadowsocksRelay) NewConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error {
|
||||
return h.service.NewConnection(adapter.WithContext(log.ContextWithNewID(ctx), &metadata), conn, adapter.UpstreamMetadata(metadata))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user