mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-09-09 13:04:06 +08:00
add inbound options
This commit is contained in:
parent
9d81d8a2b9
commit
8fb71028e2
@ -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 {
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user