添加代理访问测试
This commit is contained in:
+7
-1
@@ -19,7 +19,6 @@ func TestGet(t *testing.T) {
|
|||||||
|
|
||||||
func TestForm(t *testing.T) {
|
func TestForm(t *testing.T) {
|
||||||
|
|
||||||
|
|
||||||
file, err := os.Open("./go.mod")
|
file, err := os.Open("./go.mod")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
@@ -49,3 +48,10 @@ func TestForm(t *testing.T) {
|
|||||||
resp, code, err := NewCurlx().Send(context.Background(), SetParamsAll(p))
|
resp, code, err := NewCurlx().Send(context.Background(), SetParamsAll(p))
|
||||||
fmt.Println(resp, code, err)
|
fmt.Println(resp, code, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestProxy(t *testing.T) {
|
||||||
|
c := NewCurlx()
|
||||||
|
c.WithProxySocks5("127.0.0.1:1080")
|
||||||
|
res, code, err := c.Send(context.Background(), SetParamsUrl("https://www.google.com"),SetParamsMethod(MethodGet))
|
||||||
|
t.Log(string(res), code, err)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user