mirror of
https://github.com/fatedier/frp.git
synced 2025-07-15 02:10:49 +07:00
new feature: load balancing for tcp proxy
This commit is contained in:
@ -40,38 +40,41 @@ const (
|
||||
|
||||
var ServerService *Service
|
||||
|
||||
// Server service.
|
||||
// Server service
|
||||
type Service struct {
|
||||
// Dispatch connections to different handlers listen on same port.
|
||||
// Dispatch connections to different handlers listen on same port
|
||||
muxer *mux.Mux
|
||||
|
||||
// Accept connections from client.
|
||||
// Accept connections from client
|
||||
listener frpNet.Listener
|
||||
|
||||
// Accept connections using kcp.
|
||||
// Accept connections using kcp
|
||||
kcpListener frpNet.Listener
|
||||
|
||||
// For https proxies, route requests to different clients by hostname and other infomation.
|
||||
// For https proxies, route requests to different clients by hostname and other infomation
|
||||
VhostHttpsMuxer *vhost.HttpsMuxer
|
||||
|
||||
httpReverseProxy *vhost.HttpReverseProxy
|
||||
|
||||
// Manage all controllers.
|
||||
// Manage all controllers
|
||||
ctlManager *ControlManager
|
||||
|
||||
// Manage all proxies.
|
||||
// Manage all proxies
|
||||
pxyManager *ProxyManager
|
||||
|
||||
// Manage all visitor listeners.
|
||||
// Manage all visitor listeners
|
||||
visitorManager *VisitorManager
|
||||
|
||||
// Manage all tcp ports.
|
||||
// Manage all tcp ports
|
||||
tcpPortManager *PortManager
|
||||
|
||||
// Manage all udp ports.
|
||||
// Manage all udp ports
|
||||
udpPortManager *PortManager
|
||||
|
||||
// Controller for nat hole connections.
|
||||
// Tcp Group Controller
|
||||
tcpGroupCtl *TcpGroupCtl
|
||||
|
||||
// Controller for nat hole connections
|
||||
natHoleController *NatHoleController
|
||||
}
|
||||
|
||||
@ -84,6 +87,7 @@ func NewService() (svr *Service, err error) {
|
||||
tcpPortManager: NewPortManager("tcp", cfg.ProxyBindAddr, cfg.AllowPorts),
|
||||
udpPortManager: NewPortManager("udp", cfg.ProxyBindAddr, cfg.AllowPorts),
|
||||
}
|
||||
svr.tcpGroupCtl = NewTcpGroupCtl(svr.tcpPortManager)
|
||||
|
||||
// Init assets.
|
||||
err = assets.Load(cfg.AssetsDir)
|
||||
|
Reference in New Issue
Block a user