Documentation ¶
Index ¶
- Constants
- Variables
- type AgentUser
- type AgentUserCodeMap
- type Config
- type Peers
- type UdpAC
- func (d *UdpAC) AddServerPeer(server *core.UdpPeer)
- func (d *UdpAC) DeleteAccessToken(au *AgentUser)
- func (d *UdpAC) GenerateAccessToken(au *AgentUser) string
- func (d *UdpAC) HandleACOperations(ppd *core.PacketParserData) (err error)
- func (d *UdpAC) IpPassMode() int
- func (d *UdpAC) IsRunning() bool
- func (d *UdpAC) RemoveServerPeer(serverKey string)
- func (d *UdpAC) ResolvePeer(peer *core.UdpPeer) (*core.UdpPeer, net.Addr)
- func (d *UdpAC) SendPacket(pkt *core.Packet, conn *UdpConn) (n int, err error)
- func (d *UdpAC) Start(dirPath string, logLevel int) (err error)
- func (d *UdpAC) Stop()
- func (d *UdpAC) StopConfigWatch()
- func (d *UdpAC) VerifyAccessToken(au *AgentUser, token string) bool
- type UdpConn
Constants ¶
View Source
const ( MaxConcurrentConnection = 256 DefaultConnectionTimeoutMs = 300 * 1000 // 300 seconds to delete idle connection, align with server PacketQueueSizePerConnection = 32 ReportToServerInterval = 60 // seconds MinialServerDiscoveryInterval = 5 // seconds ServerKeepaliveInterval = 20 // seconds ServerDiscoveryRetryBeforeFail = 3 TempPortOpenTime = 30 // IPSET_DEFAULT_NAME = "defaultset" IPSET_DEFAULT_DOWN_NAME = "defaultset_down" )
View Source
const ( PASS_KNOCK_IP = iota PASS_PRE_ACCESS_IP )
IP pass mode
Variables ¶
View Source
var (
ExeDirPath string
)
Functions ¶
This section is empty.
Types ¶
type AgentUser ¶
type AgentUserCodeMap ¶
type Config ¶
type Config struct { PrivateKeyBase64 string `json:"privateKey"` ACId string `json:"acId"` DefaultIp string `json:"defaultIp"` AuthServiceId string `json:"aspId"` ResourceIds []string `json:"resIds"` Servers []*core.UdpPeer `json:"servers"` IpPassMode int `json:"ipPassMode"` // 0: pass the knock source IP, 1: use pre-access mode and release the access source IP LogLevel int `json:"logLevel"` }
type UdpAC ¶ added in v0.4.0
func (*UdpAC) AddServerPeer ¶ added in v0.4.0
func (*UdpAC) DeleteAccessToken ¶ added in v0.4.0
func (*UdpAC) GenerateAccessToken ¶ added in v0.4.0
func (*UdpAC) HandleACOperations ¶ added in v0.4.0
func (d *UdpAC) HandleACOperations(ppd *core.PacketParserData) (err error)
func (*UdpAC) IpPassMode ¶ added in v0.4.0
func (*UdpAC) RemoveServerPeer ¶ added in v0.4.0
func (*UdpAC) ResolvePeer ¶ added in v0.4.0
if the server uses hostname as destination, find the correct peer with the actual IP address
func (*UdpAC) SendPacket ¶ added in v0.4.0
func (*UdpAC) Start ¶ added in v0.4.0
dirPath: the path of app or shared library entry point logLevel: 0: silent, 1: error, 2: info, 3: debug, 4: verbose
func (*UdpAC) StopConfigWatch ¶ added in v0.4.0
func (d *UdpAC) StopConfigWatch()
Click to show internal directories.
Click to hide internal directories.