Feature: socks5 udp associate

This commit is contained in:
Dreamacro
2019-04-23 23:29:36 +08:00
parent 49f8902961
commit c92cda6980
25 changed files with 339 additions and 85 deletions

View File

@ -2,6 +2,7 @@ package adapters
import (
"encoding/json"
"errors"
"net"
"net/http"
"time"
@ -13,6 +14,7 @@ import (
type Base struct {
name string
tp C.AdapterType
udp bool
}
func (b *Base) Name() string {
@ -23,6 +25,14 @@ func (b *Base) Type() C.AdapterType {
return b.tp
}
func (b *Base) DialUDP(metadata *C.Metadata) (net.PacketConn, net.Addr, error) {
return nil, nil, errors.New("no support")
}
func (b *Base) SupportUDP() bool {
return b.udp
}
func (b *Base) Destroy() {}
func (b *Base) MarshalJSON() ([]byte, error) {