mirror of
https://github.com/fatedier/frp.git
synced 2026-01-11 22:23:12 +00:00
code optimization (#3625)
This commit is contained in:
@@ -21,6 +21,7 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/fatedier/golib/errors"
|
||||
pp "github.com/pires/go-proxyproto"
|
||||
|
||||
v1 "github.com/fatedier/frp/pkg/config/v1"
|
||||
)
|
||||
@@ -47,11 +48,14 @@ func Create(name string, options v1.ClientPluginOptions) (p Plugin, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type ExtraInfo struct {
|
||||
ProxyProtocolHeader *pp.Header
|
||||
}
|
||||
|
||||
type Plugin interface {
|
||||
Name() string
|
||||
|
||||
// extraBufToLocal will send to local connection first, then join conn with local connection
|
||||
Handle(conn io.ReadWriteCloser, realConn net.Conn, extraBufToLocal []byte)
|
||||
Handle(conn io.ReadWriteCloser, realConn net.Conn, extra *ExtraInfo)
|
||||
Close() error
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user