add inbound options

This commit is contained in:
Mobin 2025-09-03 20:50:49 +03:30
parent 9d81d8a2b9
commit 8fb71028e2
2 changed files with 21 additions and 0 deletions

View File

@ -3,9 +3,22 @@ package adapter
import (
"context"
"net"
"github.com/sagernet/sing/common/exceptions"
"github.com/sagernet/sing/common/network"
)
type WSCServerTransport interface {
Network() []string
Serve(listener net.Listener) error
ServePacket(listener net.PacketConn) error
Close() error
}
type WSCServerTransportHandler interface {
network.TCPConnectionHandler
network.UDPConnectionHandler
exceptions.Handler
}
type WSCClientTransport interface {

View File

@ -1,7 +1,15 @@
package option
type WSCUsageReport struct {
Traffic int64 `json:"traffic,omitempty"`
Time Duration `json:"time,omitempty"`
}
type WSCInboundOptions struct {
ListenOptions
InboundTLSOptionsContainer
MaxConnectionPerUser int `json:"max_connections,omitempty"`
UsageTraffic WSCUsageReport `json:"usage_traffic,omitempty"`
}
type WSCOutboundOptions struct {