根據(jù)國(guó)務(wù)院辦公廳《國(guó)務(wù)院辦公廳關(guān)于2024年部分節(jié)假日安排的通知》,2024年春節(jié)放假安排通知如下:2月10日(星期六,初一) 至2月17日 (星期六,初八) 放假調(diào)休共8天。2月4日(星期日)、2月18日(星期日) 上班。放假期間如有售后問(wèn)題請(qǐng)聯(lián)系值班QQ:475685360。
國(guó)內(nèi)專業(yè)固定IP提供商! 我們有專業(yè)的技術(shù)團(tuán)隊(duì)!專業(yè)的設(shè)備!提供多種接入方式!助您快速解決問(wèn)題。
當(dāng)前位置: 網(wǎng)站首頁(yè)
>>使用幫助
go語(yǔ)言中如何接入http代理ip
時(shí)間:2018-11-07 來(lái)源:楓之葉網(wǎng)絡(luò)
go語(yǔ)言中如何接入http代理ip,代碼如下:
package main
import (
"net/url"
"net/http"
"bytes"
"fmt"
"io/ioutil"
)
const ProxyServer = "www.xbltjxp.cn:9010"
type ProxyAuth struct {
License string
SecretKey string
}
func (p ProxyAuth) ProxyClient() http.Client {
proxyURL, _ := url.Parse("http://" + p.License + ":" + p.SecretKey + "@" + ProxyServer)
return http.Client{Transport: &http.Transport{Proxy:http.ProxyURL(proxyURL)}}
}
func main() {
targetURI := "http://www.xbltjxp.cn"
// 初始化 proxy http client
client := ProxyAuth{License: "www.xbltjxp.cn", SecretKey: "www.xbltjxp.cn"}.ProxyClient()
request, _ := http.NewRequest("GET", targetURI, bytes.NewBuffer([] byte(``)))
// 切換IP (只支持 HTTP)
request.Header.Set("Proxy-Switch-Ip", "yes")
response, err := client.Do(request)
if err != nil {
panic("failed to connect: " + err.Error())
} else {
bodyByte, err := ioutil.ReadAll(response.Body)
if err != nil {
fmt.Println("讀取 Body 時(shí)出錯(cuò)", err)
return
}
response.Body.Close()
body := string(bodyByte)
fmt.Println("Response Status:", response.Status)
fmt.Println("Response Header:", response.Header)
fmt.Println("Response Body:\n", body)
}
}
當(dāng)前地址:http://www.xbltjxp.cn/support/a158.html 客服聯(lián)系QQ:475685360
時(shí)間:2018-11-07 來(lái)源:楓之葉網(wǎng)絡(luò)
go語(yǔ)言中如何接入http代理ip,代碼如下:
當(dāng)前地址:http://www.xbltjxp.cn/support/a158.html 客服聯(lián)系QQ:475685360
package main
import (
"net/url"
"net/http"
"bytes"
"fmt"
"io/ioutil"
)
const ProxyServer = "www.xbltjxp.cn:9010"
type ProxyAuth struct {
License string
SecretKey string
}
func (p ProxyAuth) ProxyClient() http.Client {
proxyURL, _ := url.Parse("http://" + p.License + ":" + p.SecretKey + "@" + ProxyServer)
return http.Client{Transport: &http.Transport{Proxy:http.ProxyURL(proxyURL)}}
}
func main() {
targetURI := "http://www.xbltjxp.cn"
// 初始化 proxy http client
client := ProxyAuth{License: "www.xbltjxp.cn", SecretKey: "www.xbltjxp.cn"}.ProxyClient()
request, _ := http.NewRequest("GET", targetURI, bytes.NewBuffer([] byte(``)))
// 切換IP (只支持 HTTP)
request.Header.Set("Proxy-Switch-Ip", "yes")
response, err := client.Do(request)
if err != nil {
panic("failed to connect: " + err.Error())
} else {
bodyByte, err := ioutil.ReadAll(response.Body)
if err != nil {
fmt.Println("讀取 Body 時(shí)出錯(cuò)", err)
return
}
response.Body.Close()
body := string(bodyByte)
fmt.Println("Response Status:", response.Status)
fmt.Println("Response Header:", response.Header)
fmt.Println("Response Body:\n", body)
}
}
當(dāng)前地址:http://www.xbltjxp.cn/support/a158.html 客服聯(lián)系QQ:475685360
網(wǎng)站公告
使用幫助
【公告】關(guān)于禁止使用我司資源境...2022-04-29
楓之葉網(wǎng)絡(luò)2021年7~12月...2022-02-08
楓之葉網(wǎng)絡(luò)舉報(bào)中心——邀您一起...2021-12-30
paypal固定ip payp...2021-09-27
楓之葉網(wǎng)絡(luò)1~6月份違規(guī)事件處...2021-09-21
lazada店群ip Laza...2021-09-08
ebay防關(guān)聯(lián)ip ebay防...2021-07-07
【公告】關(guān)于禁止使用我司網(wǎng)絡(luò)資...2021-06-23
shopify固定ip sho...2021-02-28
【公告】楓之葉網(wǎng)絡(luò)配合國(guó)家政策...2021-01-16
【公告】關(guān)于嚴(yán)格遵守網(wǎng)絡(luò)安全法...2020-09-23
【公告】關(guān)于打擊網(wǎng)絡(luò)違法犯罪活...2020-01-10