mirror of
https://github.com/fatedier/frp.git
synced 2025-07-27 07:35:07 +00:00
move dial functions into golib (#2767)
This commit is contained in:
@@ -13,7 +13,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/fatedier/frp/test/e2e/pkg/rpc"
|
||||
libnet "github.com/fatedier/golib/net"
|
||||
libdial "github.com/fatedier/golib/net/dial"
|
||||
)
|
||||
|
||||
type Request struct {
|
||||
@@ -141,7 +141,11 @@ func (r *Request) Do() (*Response, error) {
|
||||
if r.protocol != "tcp" {
|
||||
return nil, fmt.Errorf("only tcp protocol is allowed for proxy")
|
||||
}
|
||||
conn, err = libnet.DialTcpByProxy(r.proxyURL, addr)
|
||||
proxyType, proxyAddress, auth, err := libdial.ParseProxyURL(r.proxyURL)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("parse ProxyURL error: %v", err)
|
||||
}
|
||||
conn, err = libdial.Dial(addr, libdial.WithProxy(proxyType, proxyAddress), libdial.WithProxyAuth(auth))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user