mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2025-10-05 16:56:54 +08:00
36 lines
567 B
Go
Executable File
36 lines
567 B
Go
Executable File
package proxy
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"net"
|
|
|
|
"github.com/xjasonlyu/tun2socks/common/adapter"
|
|
)
|
|
|
|
var _ Proxy = (*Base)(nil)
|
|
|
|
type Base struct {
|
|
addr string
|
|
}
|
|
|
|
func NewBase(addr string) *Base {
|
|
return &Base{addr: addr}
|
|
}
|
|
|
|
func (b *Base) Addr() string {
|
|
return b.addr
|
|
}
|
|
|
|
func (b *Base) Type() string {
|
|
return "base"
|
|
}
|
|
|
|
func (b *Base) DialContext(context.Context, *adapter.Metadata) (net.Conn, error) {
|
|
return nil, errors.New("not supported")
|
|
}
|
|
|
|
func (b *Base) DialUDP(*adapter.Metadata) (net.PacketConn, error) {
|
|
return nil, errors.New("not supported")
|
|
}
|