mirror of
https://github.com/ICKelin/opennotr.git
synced 2025-10-05 15:56:50 +08:00
optimize: rename some structs
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user