Documentation ¶
Index ¶
Constants ¶
View Source
const ( OptAdd = 1 OptDel = 2 OptReset = 3 OptPing = 9 )
MUCmd opt id
View Source
const ( ResOK = 1 ResErr = 2 )
MURes res id
Variables ¶
View Source
var ( //SIP003 ErrBrokenSIP003Args = errors.New("invalid SIP003 args") //smux ErrTooManyStreams = errors.New("opened too many streams") )
err
Functions ¶
func FormatSSPluginOptions ¶
FormatSSPluginOptions formats SS_PLUGIN_OPTIONS to command alike formation, `-s -a value`
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a client instance
func (*Client) ForwardConn ¶ added in v0.5.5
ForwardConn forwards this connection to server. It will block until server-side connection is closed or c is closed
type ClientConfig ¶
type ClientConfig struct { BindAddr string RemoteAddr string EnableWSS bool WSSPath string EnableMux bool MuxMaxStream int ServerName string InsecureSkipVerify bool Timeout time.Duration EnableTFO bool VpnMode bool FallbackDNS string Verbose bool }
ClientConfig is a config
type MURes ¶ added in v0.5.4
type MURes struct { Res int `json:"res,omitempty"` ErrString string `json:"err_string,omitempty"` CurrentUsers int `json:"current_users,omitempty"` }
MURes is a update result
type MUServer ¶ added in v0.5.4
type MUServer struct {
// contains filtered or unexported fields
}
MUServer is a multi-user server
func NewMUServer ¶ added in v0.5.4
func NewMUServer(conf *MUServerConfig) (*MUServer, error)
NewMUServer init a multi-user server
func (*MUServer) CloseController ¶ added in v0.5.4
func (*MUServer) CloseServer ¶ added in v0.5.4
func (*MUServer) ServeHTTP ¶ added in v0.5.4
func (mus *MUServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*MUServer) StartController ¶ added in v0.5.4
StartController starts the controller of the server
func (*MUServer) StartServer ¶ added in v0.5.5
StartServer starts the server
type MUServerConfig ¶ added in v0.5.4
type MUServerConfig struct { ServerAddr string ServerBindUnix bool HTTPControllerAddr string Key string Cert string ServerName string DisableTLS bool EnableMux bool EnableTFO bool Timeout time.Duration Verbose bool }
MUServerConfig multi-user server config
type SIP003Args ¶
type SIP003Args struct { SS_REMOTE_HOST string SS_REMOTE_PORT string SS_LOCAL_HOST string SS_LOCAL_PORT string SS_PLUGIN_OPTIONS string VPN bool TFO bool }
SIP003Args contains sip003 args
func GetSIP003Args ¶
func GetSIP003Args() (*SIP003Args, error)
GetSIP003Args get sip003 args from os.Environ(), if no args, returns nil
func (*SIP003Args) GetLocalAddr ¶
func (args *SIP003Args) GetLocalAddr() string
func (*SIP003Args) GetRemoteAddr ¶
func (args *SIP003Args) GetRemoteAddr() string
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents a Server instance
func NewServer ¶
func NewServer(c *ServerConfig) (*Server, error)
func (*Server) ActiveAndServe ¶ added in v0.5.5
Click to show internal directories.
Click to hide internal directories.