add plugin system

This commit is contained in:
ginuerzh
2023-04-18 20:52:56 +08:00
parent 7576651a67
commit 32c8188351
48 changed files with 761 additions and 115 deletions

View File

@ -1,6 +1,7 @@
package wrapper
import (
"context"
"net"
"github.com/go-gost/core/admission"
@ -28,7 +29,7 @@ func (ln *listener) Accept() (net.Conn, error) {
return nil, err
}
if ln.admission != nil &&
!ln.admission.Admit(c.RemoteAddr().String()) {
!ln.admission.Admit(context.Background(), c.RemoteAddr().String()) {
c.Close()
continue
}