optimize: rename some structs

This commit is contained in:
ICKelin
2021-04-30 23:22:01 +08:00
parent 0064d10fdc
commit e59425baeb
6 changed files with 56 additions and 55 deletions

View File

@@ -12,21 +12,21 @@ import (
)
func init() {
plugin.RegisterProxier("tcp", &TCPProxy{})
plugin.Register("tcp", &TCPProxy{})
}
type TCPProxy struct{}
func (t *TCPProxy) Setup(config json.RawMessage) error { return nil }
func (t *TCPProxy) StopProxy(item *plugin.ProxyItem) {
func (t *TCPProxy) StopProxy(item *plugin.PluginMeta) {
select {
case item.RecycleSignal <- struct{}{}:
default:
}
}
func (t *TCPProxy) RunProxy(item *plugin.ProxyItem) error {
func (t *TCPProxy) RunProxy(item *plugin.PluginMeta) error {
from, to := item.From, item.To
lis, err := net.Listen("tcp", from)
if err != nil {