github.com/gospider007/requests@v0.0.0-20240506025355-c73d46169a23/test/proxy/disProxy_test.go (about)

     1  package main
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/gospider007/requests"
     7  )
     8  
     9  func TestDisProxy(t *testing.T) {
    10  	resp, err := requests.Get(nil, "https://httpbin.org/anything", requests.RequestOption{
    11  		Proxy:    "http://192.368.7.256:9887",
    12  		DisProxy: true,
    13  	})
    14  	if err != nil {
    15  		t.Error(err)
    16  	}
    17  	if resp.StatusCode() != 200 {
    18  		t.Error("status code is not 200")
    19  	}
    20  }