Documentation ¶
Index ¶
- Constants
- func CanProxy(addr string) bool
- func Dial(ctx context.Context, network, addr string) (c net.Conn, err error)
- func GetVarValue(object VarObject, name string) (value string, ok bool)
- func NetListen(listen *Listen) (net.Listener, error)
- func NetListenConcurrent(ctx context.Context, ln net.Listener, maxConnection ConnectionNum) (l net.Listener, err error)
- func NetListenConcurrentAndName(ctx context.Context, ln net.Listener, maxConnection ConnectionNum, name string) (l net.Listener, err error)
- func NetListenTLS(ln net.Listener, file *TlsFile) (l net.Listener, err error)
- func StartAndBlock(name string, config *Net, handler func(conn *Conn))
- type Conn
- type ConnectionNum
- type Handler
- type HandlerFun
- type Listen
- type Net
- type Server
- type TlsFile
- type VarObject
Constants ¶
View Source
const MaxConnNotLimit = -1
Variables ¶
This section is empty.
Functions ¶
func NetListenConcurrent ¶
func StartAndBlock ¶
Deprecated
Types ¶
type ConnectionNum ¶
type ConnectionNum int64
func (ConnectionNum) Value ¶
func (n ConnectionNum) Value() int64
type HandlerFun ¶
type HandlerFun func(conn *Conn)
func (HandlerFun) Handle ¶
func (h HandlerFun) Handle(conn *Conn)
type Net ¶
type Net struct { Listen Listen `conf:",1、xxx.xxx.xxx.xxx:[0-9] 2、:[0-9] 3、pipe:[0-9] 4、unix:|xxx|xxx|xxx|xxx.socket:0"` MaxConnections ConnectionNum `conf:",-1:not limit"` TLS bool TlsFile TlsFile }
func DefaultNetConfig ¶
func DefaultNetConfig() *Net
type Server ¶
func (*Server) ServeAndBlock ¶
func (s *Server) ServeAndBlock()
type TlsFile ¶
type TlsFile struct { PrivateKeyPEMFile string `conf:",support relative path, must PEM encode data"` CertPEMFile string `conf:",support relative path, must PEM encode data"` }
func (*TlsFile) RealCertFile ¶
func (*TlsFile) RealKeyFile ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.