check: stop checking when protocol not supported

This commit is contained in:
nadoo committed 2020-11-26 19:21:27 +08:00
1 parent 6820644073
commit 98ce20b295
9 files changed
+69 -122

No files matched your search

+2 -2
View File
@@ -1,6 +1,7 @@
package udp
import (
"fmt"
"net"
"net/url"
"sync"
@@ -15,7 +16,6 @@ type UDP struct {
addr string
dialer proxy.Dialer
proxy proxy.Proxy
server proxy.Server
}
func init() {
@@ -120,7 +120,7 @@ func (s *UDP) Addr() string {
// Dial connects to the address addr on the network net via the proxy.
func (s *UDP) Dial(network, addr string) (net.Conn, error) {
return s.dialer.Dial("udp", s.addr)
return nil, fmt.Errorf("can not dial tcp via udp dialer: %w", proxy.ErrNotSupported)
}
// DialUDP connects to the given address via the proxy.