xjasonlyu
3 years ago
3 changed files with 20 additions and 19 deletions
@ -0,0 +1,18 @@ |
|||
package mirror |
|||
|
|||
import ( |
|||
"github.com/xjasonlyu/tun2socks/v2/core/adapter" |
|||
"github.com/xjasonlyu/tun2socks/v2/tunnel" |
|||
) |
|||
|
|||
var _ adapter.TransportHandler = (*Tunnel)(nil) |
|||
|
|||
type Tunnel struct{} |
|||
|
|||
func (*Tunnel) HandleTCP(conn adapter.TCPConn) { |
|||
tunnel.TCPIn() <- conn |
|||
} |
|||
|
|||
func (*Tunnel) HandleUDP(conn adapter.UDPConn) { |
|||
tunnel.UDPIn() <- conn |
|||
} |
@ -1,18 +0,0 @@ |
|||
package engine |
|||
|
|||
import ( |
|||
"github.com/xjasonlyu/tun2socks/v2/core/adapter" |
|||
"github.com/xjasonlyu/tun2socks/v2/tunnel" |
|||
) |
|||
|
|||
var _ adapter.TransportHandler = (*fakeTunnel)(nil) |
|||
|
|||
type fakeTunnel struct{} |
|||
|
|||
func (*fakeTunnel) HandleTCP(conn adapter.TCPConn) { |
|||
tunnel.TCPIn() <- conn |
|||
} |
|||
|
|||
func (*fakeTunnel) HandleUDP(conn adapter.UDPConn) { |
|||
tunnel.UDPIn() <- conn |
|||
} |
Loading…
Reference in new issue