Documentation
¶
Index ¶
- Constants
- Variables
- func EnsurePort(server string, tp string) string
- func GetProxyConn(proxyUrl, server string, timeout time.Duration, localIP string) (net.Conn, error)
- func GetTaskStatus(server string, vKey string, tp string, proxyUrl string, localIP string)
- func NewConn(tp string, vkey string, server string, proxyUrl string, localIP string) (*conn.Conn, string, error)
- func RegisterLocalIp(server string, vKey string, tp string, proxyUrl string, localIP string, ...)
- func SendType(c *conn.Conn, connType, uuid string) error
- func StartFromFile(pCtx context.Context, pCancel context.CancelFunc, path string)
- func VerifyState(state tls.ConnectionState, host string) (fingerprint []byte, verified bool)
- func VerifyTLS(connection net.Conn, host string) (fingerprint []byte, verified bool)
- type Closer
- type FileServerManager
- type HealthChecker
- type P2PManager
- type P2pBridge
- type TRPClient
Constants ¶
const MaxPad = 64
Variables ¶
var AutoReconnect = true
var DisableP2P = false
var HasFailed = false
var LocalIPForward = false
var NowStatus int
var QuicConfig = &quic.Config{ KeepAlivePeriod: 10 * time.Second, MaxIdleTimeout: 30 * time.Second, MaxIncomingStreams: 100000, }
var SkipTLSVerify = false
var Ver = version.GetLatestIndex()
Functions ¶
func EnsurePort ¶ added in v0.29.3
func GetProxyConn ¶ added in v0.30.4
GetProxyConn dials server directly, through proxyUrl, or through the proxy configured in ALL_PROXY and NO_PROXY. proxyUrl may use the http, https, socks5, socks5h, socks4 and socks4a schemes, or be a bare host:port, which is taken as an http proxy. The whole dial, including any proxy handshake, is bounded by timeout.
func GetTaskStatus ¶
func NewConn ¶
func NewConn(tp string, vkey string, server string, proxyUrl string, localIP string) (*conn.Conn, string, error)
NewConn Create a new connection with the server and verify it
func RegisterLocalIp ¶
func StartFromFile ¶
func StartFromFile(pCtx context.Context, pCancel context.CancelFunc, path string)
func VerifyState ¶ added in v0.29.26
func VerifyState(state tls.ConnectionState, host string) (fingerprint []byte, verified bool)
Types ¶
type FileServerManager ¶ added in v0.29.5
type FileServerManager struct {
// contains filtered or unexported fields
}
func NewFileServerManager ¶ added in v0.29.5
func NewFileServerManager(parentCtx context.Context) *FileServerManager
func (*FileServerManager) CloseAll ¶ added in v0.29.5
func (fsm *FileServerManager) CloseAll()
func (*FileServerManager) GetListenerByKey ¶ added in v0.30.6
func (fsm *FileServerManager) GetListenerByKey(key string) (*netx.ChanListener, bool)
func (*FileServerManager) StartFileServer ¶ added in v0.29.5
func (fsm *FileServerManager) StartFileServer(t *file.Tunnel, vkey string)
type HealthChecker ¶ added in v0.29.5
type HealthChecker struct {
// contains filtered or unexported fields
}
func NewHealthChecker ¶ added in v0.29.5
func (*HealthChecker) Reset ¶ added in v0.29.5
func (hc *HealthChecker) Reset()
func (*HealthChecker) Start ¶ added in v0.29.5
func (hc *HealthChecker) Start()
func (*HealthChecker) Stop ¶ added in v0.29.5
func (hc *HealthChecker) Stop()
type P2PManager ¶ added in v0.29.5
type P2PManager struct {
// contains filtered or unexported fields
}
P2PManager runs the local sections of a visitor: their listeners, the relay (secret) tunnel and one direct path per P2P task.
func NewP2PManager ¶ added in v0.29.5
func NewP2PManager(pCtx context.Context, pCancel context.CancelFunc, cfg *config.CommonConfig) *P2PManager
func (*P2PManager) Close ¶ added in v0.29.5
func (mgr *P2PManager) Close()
Close stops the listeners, the direct paths and the relay tunnel, and waits for the direct paths' goroutines.
func (*P2PManager) StartLocalServer ¶ added in v0.29.5
func (mgr *P2PManager) StartLocalServer(l *config.LocalServer) error
type P2pBridge ¶ added in v0.32.3
type P2pBridge struct {
// contains filtered or unexported fields
}
func NewP2pBridge ¶ added in v0.32.3
func NewP2pBridge(mgr *P2PManager, l *config.LocalServer) *P2pBridge
func (*P2pBridge) SendLinkInfo ¶ added in v0.32.3
SendLinkInfo opens a connection to the task's target: over the direct path when it is up, otherwise, or when opening a stream on it fails, over the relay if the section allows it. A direct path that fails a connection takes no new connections while it is checked; it is closed and punched again only when its checks fail too. Without a relay the connection waits up to the bridge timeout for a direct path.
type TRPClient ¶
type TRPClient struct {
// contains filtered or unexported fields
}
func NewRPClient ¶
func NewRPClient(svrAddr, vKey, bridgeConnType, proxyUrl, localIP, uuid string, cnf *config.Config, disconnectTime int, fsm *FileServerManager) *TRPClient
NewRPClient new client