亚洲日韩va无码中文字幕,亚洲国产美女精品久久久久,亚洲男同gay在线观看,亚洲乱亚洲乱妇,亚洲精品综合一区二区

new
IPv6代理
微信客服
返回頂部

全球IP代理服務(wù)商
千萬(wàn)優(yōu)質(zhì)動(dòng)態(tài)住宅

匯集全球200+國(guó)家地區(qū)的真實(shí)住宅IP,支持HTTP/HTTPS/SOCKS5代理協(xié)議,讓數(shù)據(jù)采集更簡(jiǎn)單。

注:本產(chǎn)品需在境外網(wǎng)絡(luò)環(huán)境下使用
roxlabs代理http
  • 1000萬(wàn)+IP

    純凈住宅代理

  • 200+國(guó)家地區(qū)

    全球覆蓋

  • 99.9%

    高可用率

  • 24/7

    實(shí)時(shí)技術(shù)支持

Roxlabs代理的核心優(yōu)勢(shì)

roxlabs代理http

不限并發(fā)會(huì)話(huà)

Roxlabs支持無(wú)限并發(fā)會(huì)話(huà),高帶寬,無(wú)需額外費(fèi)用,滿(mǎn)足您的業(yè)務(wù)拓展需求。
roxlabs代理http

城市級(jí)定位

Roxlabs提供國(guó)家地區(qū)、城市和州級(jí)精準(zhǔn)定位IP,支持HTTP(S)/Socks5代理協(xié)議。
roxlabs代理http

流量不過(guò)期

Roxlabs動(dòng)態(tài)住宅代理的流量套餐不限使用時(shí)間,無(wú)需擔(dān)心剩余流量過(guò)期。
住宅IP代理

代理快速響應(yīng)

Roxlabs代理高帶寬,IP資源池24小時(shí)去重,保障動(dòng)態(tài)住宅代理快速運(yùn)行,平均響應(yīng)時(shí)間為0.6秒。技術(shù)團(tuán)隊(duì)全程監(jiān)測(cè)系統(tǒng),客服團(tuán)隊(duì)隨時(shí)解答用戶(hù)問(wèn)題。

自定義IP時(shí)效

Roxlabs動(dòng)態(tài)住宅支持1-1440分鐘自定義IP時(shí)效,可以根據(jù)業(yè)務(wù)需求自主設(shè)定會(huì)話(huà)時(shí)長(zhǎng)。支持HTTP/HTTPS/SOCKS5代理協(xié)議,自由設(shè)置API提取導(dǎo)出格式。

數(shù)據(jù)中心代理IP
數(shù)據(jù)采集IP代理

數(shù)據(jù)統(tǒng)計(jì)中心

Roxlabs個(gè)人中心實(shí)時(shí)統(tǒng)計(jì)代理使用數(shù)據(jù),您可以隨時(shí)查看賬戶(hù)余額信息和流量使用情況,支持添加多個(gè)IP白名單和認(rèn)證賬戶(hù),更有IP管理、認(rèn)證賬戶(hù)管理等功能。

全球熱門(mén)代理地區(qū)

1000萬(wàn)+純凈住宅IP
覆蓋200+國(guó)家地區(qū)
HTTP/HTTPS/SOCKS5
美國(guó)靜態(tài)代理IP
美國(guó)
2,106,985 IPs
印度靜態(tài)代理IP
印度
1,654,358 IPs
英國(guó)靜態(tài)代理IP
英國(guó)
476,412 IPs
土耳其靜態(tài)代理IP
土耳其
89,398 IPs
加拿大靜態(tài)代理IP
加拿大
384,218 IPs
巴西靜態(tài)代理IP
巴西
421,498 IPs
意大利靜態(tài)代理IP
意大利
921,546 IPs
馬來(lái)西亞靜態(tài)代理IP
馬來(lái)西亞
152,784 IPs
德國(guó)靜態(tài)代理IP
德國(guó)
421,362 IPs
印度尼西亞靜態(tài)代理IP
印度尼西亞
132,158 IPs
越南靜態(tài)代理IP
越南
148,628 IPs
法國(guó)靜態(tài)代理IP
法國(guó)
215,688 IPs
更多地區(qū)資源
加拿大
384,218 IPs
美國(guó)
2,106,985 IPs
巴西
421,498 IPs
英國(guó)
476,412 IPs
法國(guó)
215,688 IPs
意大利
921,546 IPs
越南
148,628 IPs
德國(guó)
421,362 IPs
土耳其
89,398 IPs
印度
1,654,358 IPs
馬來(lái)西亞
152,784 IPs
印度尼西亞
132,158 IPs

優(yōu)質(zhì)大數(shù)據(jù)采集解決方案

高性?xún)r(jià)比的代理資源,為企業(yè)提供完善代理服務(wù)
平均 99.2% 成功率
24/7 實(shí)時(shí)支持
城市級(jí)定位
  • 動(dòng)態(tài)住宅代理

    便于大數(shù)據(jù)采集的高匿輪轉(zhuǎn)住宅IP

    1000萬(wàn)+動(dòng)態(tài)住宅IP
    查看價(jià)格
    無(wú)限并發(fā)會(huì)話(huà)
    城市級(jí)精準(zhǔn)定位
    流量不過(guò)期
  • 靜態(tài)住宅代理

    99.9%正常穩(wěn)定運(yùn)行的長(zhǎng)效住宅IP

    50萬(wàn)+靜態(tài)住宅
    查看價(jià)格
    原生獨(dú)享IP
    不限流量
    支持HTTP(S)/Socks5代理協(xié)議
  • 獨(dú)享數(shù)據(jù)中心代理

    便于獲取的優(yōu)質(zhì)高速長(zhǎng)效機(jī)房IP

    60萬(wàn)+獨(dú)享數(shù)據(jù)中心
    查看價(jià)格
    個(gè)人專(zhuān)享IP
    不限流量
    支持HTTP(S)/Socks5代理協(xié)議

免費(fèi)定制專(zhuān)屬解決方案

專(zhuān)享代理資源池
高性?xún)r(jià)比價(jià)格,節(jié)約企業(yè)成本
自定義IP時(shí)效,滿(mǎn)足多種業(yè)務(wù)需求
一對(duì)一客戶(hù)服務(wù),隨時(shí)解決問(wèn)題
技術(shù)團(tuán)隊(duì)全程監(jiān)測(cè),保障系統(tǒng)穩(wěn)定運(yùn)行

Roxlabs常見(jiàn)應(yīng)用場(chǎng)景

為跨境電商、社交媒體、網(wǎng)絡(luò)安全、市場(chǎng)調(diào)研等行業(yè)提供專(zhuān)業(yè)的大數(shù)據(jù)采集解決方案

數(shù)據(jù)采集

輕松實(shí)現(xiàn)高效數(shù)據(jù)采集,提高工作效率和質(zhì)量

SEO監(jiān)測(cè)

實(shí)時(shí)掌握有關(guān)競(jìng)爭(zhēng)性SEO實(shí)踐和策略的數(shù)據(jù)

競(jìng)品追蹤

及時(shí)獲取新的競(jìng)品信息及定價(jià)數(shù)據(jù)

廣告驗(yàn)證

保障產(chǎn)品在全球范圍內(nèi)的廣告投放準(zhǔn)確性

品牌保護(hù)

防止假冒偽劣品牌損害正品形象和利益

市場(chǎng)調(diào)查

收集市場(chǎng)真實(shí)有效數(shù)據(jù),保持競(jìng)爭(zhēng)優(yōu)勢(shì)

賬號(hào)管理

創(chuàng)建和管理不同平臺(tái)的賬號(hào),滿(mǎn)足多任務(wù)需求

網(wǎng)絡(luò)安全

避免遭受網(wǎng)絡(luò)惡意攻擊,保護(hù)隱私安全

網(wǎng)站測(cè)試

幫助測(cè)試網(wǎng)站參數(shù),保障網(wǎng)站本地化

旅游聚合

獲取優(yōu)惠的機(jī)票酒店價(jià)格,節(jié)約旅游成本

Roxlabs多種代碼輕松集成

各種常見(jiàn)的爬蟲(chóng)編程語(yǔ)言代碼示例以及API參數(shù)注釋確保您可以快速開(kāi)始使用Roxlabs
C++
Go
Node.js
PHP
JAVA
Python
python-selenium
                            
    from selenium import webdriver
    import requests

    def seleniumSetUP(ip,port):
        # 設(shè)置Chrome驅(qū)動(dòng)程序的路徑
        chromedriver_path = './chromedriver.exe'
        # 創(chuàng)建Chrome瀏覽器實(shí)例
        chrome_options = webdriver.ChromeOptions()
        browser = webdriver.Chrome(chromedriver_path, chrome_options=chrome_options)
        # 配置獲取到的ip和port
        chrome_options.add_argument(f'--proxy-server=http://{ip}:{port}')
        # 使用代理訪(fǎng)問(wèn)
        browser.get('http://ipinfo.io')
        print(browser.page_source)

    if __name__ == '__main__':
        # 獲取代理的url,一次僅獲取一條
        porxyUrl = "http://api.tq.roxlabs.cn/getProxyIp?num=1&return_type=txt&lb=1&sb=0&flow=1®ions=&protocol=http"
        # 訪(fǎng)問(wèn)并獲取代理
        ipInfo = requests.get(porxyUrl)
        info = ipInfo.json()["data"]
        # 解析json,獲取代理服務(wù)器地址
        ip = info[0]["ip"]
        # 解析json,獲取代理的端口
        port = info[0]["port"]
        # 獲取到的代理信息傳入到selenium中進(jìn)行配置
        seleniumSetUP(ip,port)
                            
                        
                            
    # coding=utf-8
    # !/usr/bin/env python
    import json
    import threading
    import time
    import requests as rq

    # 設(shè)置請(qǐng)求頭
    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0",
        "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
        "Accept-Language": "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2",
        "Accept-Encoding": "gzip, deflate, br"
    }
    # 測(cè)試鏈接
    testUrl = 'https://ipinfo.io'


    # 核心業(yè)務(wù)
    def testPost(host, port):
        # 配置獲取到的ip,port
        proxies = {
            # host  api獲取到的代理服務(wù)器地址
            # port  api獲取到的端口
            'http': 'http://{}:{}'.format(host, port),
            'https': 'http://{}:{}'.format(host, port),
        }
        while True:
            try:
                # 配置代理后測(cè)試
                res = rq.get(testUrl, proxies=proxies, timeout=5)
                # print(res.status_code)
                # 打印請(qǐng)求結(jié)果
                print(res.status_code, "***", res.text)
                break
            except Exception as e:
                print(e)
                break
        return


    class ThreadFactory(threading.Thread):
        def __init__(self, host, port):
            threading.Thread.__init__(self)
            self.host = host
            self.port = port

        def run(self):
            testPost(self.host, self.port)


    # 提取代理的鏈接  json類(lèi)型的返回值
    tiqu = '提取鏈接'

    while 1 == 1:
        # 每次提取10個(gè),放入線(xiàn)程中
        resp = rq.get(url=tiqu, timeout=5)
        try:
            if resp.status_code == 200:
                dataBean = json.loads(resp.text)
            else:
                print("獲取失敗")
                time.sleep(1)
                continue
        except ValueError:
            print("獲取失敗")
            time.sleep(1)
            continue
        else:
            # 解析json數(shù)組,獲取ip和port
            print("code=", dataBean["code"])
            code = dataBean["code"]
            if code == 0:
                threads = []
                for proxy in dataBean["data"]:
                    threads.append(ThreadFactory(proxy["ip"], proxy["port"]))
                for t in threads:  # 開(kāi)啟線(xiàn)程
                    t.start()
                    time.sleep(0.01)
                for t in threads:  # 阻塞線(xiàn)程
                    t.join()
        # break
        time.sleep(1)
                            
                        
                            
    #!/usr/bin/env node
    require('request-promise')({
        url: 'https://ipinfo.io',//請(qǐng)求url
        proxy: 'http://ip:port',//代理服務(wù)器地址:端口
        })
    .then(function(data){ console.log(data); },
        function(err){ console.error(err); });
                            
                        
                            
    <?php
    //代理IP設(shè)置
    $ip = "代理服務(wù)器地址";//示例:192.168.0.1
    $port = "端口";//示例:4600
    // 要訪(fǎng)問(wèn)的目標(biāo)頁(yè)面
    $targetUrl = "http://baidu.com";
    // 代理服務(wù)器
    $proxyServer = "http://$ip:$port";

    // 隧道身份信息
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $targetUrl);
    curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

    // 設(shè)置代理服務(wù)器
    curl_setopt($ch, CURLOPT_PROXYTYPE, 0); //http
    // curl_setopt($ch, CURLOPT_PROXYTYPE, 5); //sock5
    curl_setopt($ch, CURLOPT_PROXY, $proxyServer);

    // 設(shè)置隧道驗(yàn)證信息
    curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_BASIC);
    curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727;)");
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
    curl_setopt($ch, CURLOPT_TIMEOUT, 5);
    curl_setopt($ch, CURLOPT_HEADER, true);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $result = curl_exec($ch);
    $err = curl_error($ch);

    curl_close($ch);

    var_dump($err);
    var_dump($result);
                            
                        
                            
        package main

        import (
            "context"
            "fmt"
            "io/ioutil"
            "net"
            "net/http"
            "net/url"
            "strings"
            "time"
        
            "golang.org/x/net/proxy"
        )
        
        // 代理IP設(shè)置
        var ip = "代理服務(wù)器"   //示例:192.168.0.1
        var port = "端口" //示例:4600
        // 代理服務(wù)器
        var proxyServer = "http://" + ip + ":" + port
        
        // 測(cè)試地址
        var testApi = "https://ipinfo.io"
        
        func main() {
            var proxyIP = proxyServer
            go httpProxy(proxyIP, "", "")
            go Socks5Proxy(proxyIP, "", "")
            time.Sleep(time.Minute)
        }
        
        // http代理
        func httpProxy(proxyUrl, user, pass string) {
            defer func() {
                if err := recover(); err != nil {
                    fmt.Println(time.Now().Format("2006-01-02 15:04:05 07"), "http", "response:", err)
                }
            }()
            urli := url.URL{}
        
            if !strings.Contains(proxyUrl, "http") {
                proxyUrl = fmt.Sprintf("http://%s", proxyUrl)
            }
        
            urlProxy, _ := urli.Parse(proxyUrl)
            if user != "" && pass != "" {
                urlProxy.User = url.UserPassword(user, pass)
            }
        
            client := &http.Client{
                Transport: &http.Transport{
                    Proxy: http.ProxyURL(urlProxy),
                },
            }
            rqt, err := http.NewRequest("GET", testApi, nil)
            if err != nil {
                panic(err)
                return
            }
            response, err := client.Do(rqt)
            if err != nil {
                panic(err)
                return
            }
        
            defer response.Body.Close()
            body, _ := ioutil.ReadAll(response.Body)
            fmt.Println(time.Now().Format("2006-01-02 15:04:05 07"), proxyUrl, "【http success】", "response:", response.Status, string(body))
        
            return
        }
        
        // socks5代理
        func Socks5Proxy(proxyUrl, user, pass string) {
        
            defer func() {
                if err := recover(); err != nil {
                    fmt.Println(time.Now().Format("2006-01-02 15:04:05 07"), proxyUrl, "response:", err)
                }
            }()
        
            var userAuth proxy.Auth
            if user != "" && pass != "" {
                userAuth.User = user
                userAuth.Password = pass
            }
            dialer, err := proxy.SOCKS5("tcp", proxyUrl, &userAuth, proxy.Direct)
            if err != nil {
                panic(err)
            }
            httpClient := &http.Client{
                Transport: &http.Transport{
                    DialContext: func(ctx context.Context, network, addr string) (conn net.Conn, err error) {
                        return dialer.Dial(network, addr)
                    },
                },
                Timeout: time.Second * 10,
            }
        
            if resp, err := httpClient.Get(testApi); err != nil {
                panic(err)
            } else {
                defer resp.Body.Close()
                body, _ := ioutil.ReadAll(resp.Body)
                fmt.Println(time.Now().Format("2006-01-02 15:04:05 07"), proxyUrl, "【socks5 success】", "response:", string(body))
            }
        }                                
                            
                        
                            
    package demo;

    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    
    import java.io.IOException;
    import java.net.InetSocketAddress;
    import java.net.Proxy;
    
    /**
        * compile 'com.squareup.okhttp3:okhttp:4.9.3'
        */
    class ApiProxyJava {
        public static void main(String[] args) throws IOException {
            testHttpWithOkHttp();
            testSocks5WithOkHttp();
        }
    
        /**
            * http代理
            */
        public static void testHttpWithOkHttp() throws IOException {
            //定義要訪(fǎng)問(wèn)的URL
            String url = "https://ipinfo.io";
            //創(chuàng)建一個(gè)HTTP類(lèi)型的代理對(duì)象,設(shè)置代理服務(wù)器IP地址和端口號(hào):
            Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("ip", "port"));//這里的 "ip" 和 "port"應(yīng)替換為代理服務(wù)器地址和端口。
            //構(gòu)建一個(gè)OkHttpClient實(shí)例,并配置好HTTP代理:
            OkHttpClient client = new OkHttpClient().newBuilder().proxy(proxy).build();
            //發(fā)送GET請(qǐng)求并獲取響應(yīng):
            Request request = new Request.Builder().url(url).build();
            okhttp3.Response response = client.newCall(request).execute();
            //獲取并打印響應(yīng)內(nèi)容
            String responseString = response.body().string();
            System.out.println(responseString);
        }
    
        /**
            * SOCKS5代理
            */
        public static void testSocks5WithOkHttp() throws IOException {
            //定義要訪(fǎng)問(wèn)的URL
            String url = "https://ipinfo.io";
            //創(chuàng)建一個(gè)SOCKS類(lèi)型的代理對(duì)象,設(shè)置代理服務(wù)器IP地址和端口號(hào):
            Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("ip", "port"));//這里的 "ip" 和 "port"應(yīng)替換為實(shí)際的SOCKS代理服務(wù)器地址和端口。
            //構(gòu)建一個(gè)OkHttpClient實(shí)例,并配置好SOCKS代理:
            //這里使用了SOCKS代理,這意味著所有的網(wǎng)絡(luò)流量(包括TCP連接)都將通過(guò)這個(gè)SOCKS代理進(jìn)行轉(zhuǎn)發(fā)。
            OkHttpClient client = new OkHttpClient().newBuilder().proxy(proxy).build();
            //發(fā)送GET請(qǐng)求并獲取響應(yīng):
            Request request = new Request.Builder().url(url).build();
            okhttp3.Response response = client.newCall(request).execute();
            //獲取并打印響應(yīng)內(nèi)容:
            String responseString = response.body().string();
            System.out.println(responseString);
        }
    }                                
                            
                        
                            
    // demo.cpp : 定義控制臺(tái)應(yīng)用程序的入口點(diǎn)。
    //
    
    #include "stdafx.h"
    #include "curl/curl.h"
    #pragma comment(lib, "libcurl.lib")
    
    //在CURLOPT_WRITEFUNCTION設(shè)置屬性下,使用回調(diào)write_buff_data進(jìn)行處理
    static size_t write_buff_data(char *buffer, size_t size, size_t nitems, void *outstream)
    {
        memcpy(outstream, buffer, nitems*size);
        return nitems*size;
    }
    
    /*
    使用http代理
    */
    int GetUrlHTTP(char *url, char *buff)
    {
        CURL *curl;
        CURLcode res;
        curl = curl_easy_init();
        if (curl)
        {
            curl_easy_setopt(curl, CURLOPT_PROXY,"http://代理服務(wù)器地址:端口");//設(shè)置代理
            curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)buff);//void* buff 將會(huì)傳遞給回調(diào)函數(shù)write_buff_data的第四個(gè)參數(shù) void* outstream
            curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_buff_data);//在CURLOPT_WRITEFUNCTION設(shè)置屬性下,使用回調(diào)write_buff_data進(jìn)行處理
            curl_easy_setopt(curl, CURLOPT_URL, url);//設(shè)置訪(fǎng)問(wèn)的域名
            /* 如果在10秒內(nèi)速度低于50個(gè)字節(jié)/秒,則中止 */
            curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 10L);
            curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 50L);
            curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, 2000000L);/*下載最高速度*/
            res = curl_easy_perform(curl);
            curl_easy_cleanup(curl);
            if (res == CURLE_OK){
                return res;
            }else {
                printf("錯(cuò)誤代碼:%d\n", res);
                MessageBox(NULL, TEXT("獲取IP錯(cuò)誤"), TEXT("助手"), MB_ICONINFORMATION | MB_YESNO);
            }
        }
        return res;
    }
    /*
    使用socks5代理
    */
    int GetUrlSocks5(char *url, char *buff)
    {
        CURL *curl;
        CURLcode res;
        curl = curl_easy_init();
        if (curl)
        {
            curl_easy_setopt(curl, CURLOPT_PROXY, "socks5://代理服務(wù)器地址:端口");//設(shè)置代理
            curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)buff);
            curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_buff_data);
            curl_easy_setopt(curl, CURLOPT_URL, url);
            curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 10L);
            curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 50L);
            curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, 2000000L);/*下載最高速度*/
            res = curl_easy_perform(curl);
            curl_easy_cleanup(curl);
            if (res == CURLE_OK) {
                return res;
            }
            else {
                printf("錯(cuò)誤代碼:%d\n", res);
                MessageBox(NULL, TEXT("獲取IP錯(cuò)誤"), TEXT("助手"), MB_ICONINFORMATION | MB_YESNO);
            }
        }
        return res;
    }
    /*
    不使用代理
    */
    int GetUrl(char *url, char *buff)
    {
        CURL *curl;
        CURLcode res;
        curl = curl_easy_init();
        if (curl)
        {
            curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)buff);
            curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_buff_data);
            curl_easy_setopt(curl, CURLOPT_URL, url);
            curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 10L);
            curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 50L);
            curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, 2000000L);/*下載最高速度*/
            res = curl_easy_perform(curl);
            curl_easy_cleanup(curl);
            if (res == CURLE_OK)
            {
                return res;
            }
            else {
                printf("錯(cuò)誤代碼:%d\n", res);
                MessageBox(NULL, TEXT("獲取IP錯(cuò)誤"), TEXT("助手"), MB_ICONINFORMATION | MB_YESNO);
            }
        }
        return res;
    }
    int main()
    {
        char *buff=(char*)malloc(1024*1024);
        memset(buff, 0, 1024 * 1024);
    
        GetUrl("http://baidu.com", buff);
        printf("不使用代理:%s\n", buff);
    
        memset(buff, 0, 1024 * 1024);
        GetUrlHTTP("http://baidu.com", buff);
        printf("http結(jié)果:%s\n", buff);
    
        memset(buff, 0,1024 * 1024);
        GetUrlSocks5("http://baidu.com", buff);
        printf("socks5結(jié)果:%s\n", buff);
    
        free(buff);
        Sleep(10 * 1000);//等待10秒退出
        
        return 0;
    }                                
                            
                        
C++
Go
Node.js
PHP
JAVA
Python
python-selenium
                            
    '''
    注意:本方法需要安裝seleniumwire庫(kù)  pip install selenium-wire
    其他情況下 可能需要配合selenium的webdriver使用  即selenium和seleniumwire都要導(dǎo)入
    使用seleniumwire庫(kù)的目的就是減少代碼量和無(wú)意義的插件使用,方便快捷
    '''
    
    
    from seleniumwire import webdriver
    
    # selenium-wire 代理設(shè)置
    # username 用戶(hù)名
    # password 密碼
    # host 域名
    # port 端口
    seleniumwire_options = {
        'proxy': {
            'http': 'http://myusername:password@host:port',
            'https': 'http://myusername:password@host:port',
            'no_proxy': 'localhost,127.0.0.1'
        }
    }
    
    # other Chrome options
    chrome_options = webdriver.ChromeOptions()
    # 設(shè)置無(wú)頭
    chrome_options.add_argument('--headless')
    # 忽視ssl報(bào)錯(cuò)
    chrome_options.add_argument('--ignore-ssl-errors')
    driver = webdriver.Chrome('chromedriver', options=chrome_options, seleniumwire_options=seleniumwire_options)
    driver.get('https://ipinfo.io')                            
                            
                        
                            
    '''
    導(dǎo)入thread,time,request包,
    實(shí)現(xiàn)多線(xiàn)程控制,等待,http請(qǐng)求
    '''
    import _thread
    import time
    import requests
    
    # 設(shè)置請(qǐng)求頭
    headers = {
        "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like Gecko) Mobile/14G60 MicroMessenger/6.5.19 NetType/4G Language/zh_TW",
    }
    
    # 測(cè)試地址
    mainUrl = 'https://ipinfo.io'
    
    def testUrl():
        # 設(shè)置帳密代理
        proxy = {
            'http': 'http://認(rèn)證賬戶(hù)名:認(rèn)證賬戶(hù)密碼@代理服務(wù)器地址:代理服務(wù)器端口',
            'https': 'http://認(rèn)證賬戶(hù)名:認(rèn)證賬戶(hù)密碼@代理服務(wù)器地址:代理服務(wù)器端口',
        }
        try:
            res = requests.get(mainUrl, headers=headers, proxies=proxy, timeout=10)
            print(res.status_code, res.text)
        except Exception as e:
            print("訪(fǎng)問(wèn)失敗", e)
            pass
    
    # 開(kāi)啟10個(gè)線(xiàn)程進(jìn)行測(cè)試
    for i in range(0, 10):
        _thread.start_new_thread(testUrl, ())
        time.sleep(0.1)
    
    time.sleep(10)
                            
                        
                            
    #!/usr/bin/env node
    require('request-promise')({
        url: 'https://ipinfo.io',//請(qǐng)求url
        proxy: 'http://???:????@pr.roxlabs.cn:4600',//認(rèn)證賬戶(hù)名:認(rèn)證賬戶(hù)密碼@代理地址
        })
    .then(function(data){ console.log(data); },
        function(err){ console.error(err); });
                            
                        
                            
    <?php
    //賬密設(shè)置
    $user = "認(rèn)證帳戶(hù)名";
    $password = "認(rèn)證賬戶(hù)密碼";
    // 要訪(fǎng)問(wèn)的目標(biāo)頁(yè)面
    $targetUrl = "http://baidu.com";
    // 代理服務(wù)器
    $proxyServer = "代理地址";  //示例:xxx.pr.roxlabs.cn:4600;
    $proxyUserPwd = "$user:$password";

    // 隧道身份信息
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $targetUrl);
    curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

    // 設(shè)置代理服務(wù)器
    curl_setopt($ch, CURLOPT_PROXYTYPE, 0); //http
    // curl_setopt($ch, CURLOPT_PROXYTYPE, 5); //sock5
    curl_setopt($ch, CURLOPT_PROXY, $proxyServer);

    // 設(shè)置隧道驗(yàn)證信息
    curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_BASIC);
    curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727;)");
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
    curl_setopt($ch, CURLOPT_TIMEOUT, 5);
    curl_setopt($ch, CURLOPT_HEADER, true);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyUserPwd);
    $result = curl_exec($ch);
    $err = curl_error($ch);

    curl_close($ch);

    var_dump($err);
    var_dump($result);            
                            
                        
                            
    package main

    import (
        "context"
        "fmt"
        "io/ioutil"
        "net"
        "net/http"
        "net/url"
        "strings"
        "time"
    
        "golang.org/x/net/proxy"
    )
    
    // 賬密設(shè)置
    var account = "認(rèn)證帳戶(hù)名"
    var password = "認(rèn)證賬戶(hù)密碼"
    
    // 代理服務(wù)器
    var proxyServer = "代理地址"  //示例:xxx.pr.roxlabs.cn:4600;
    
    // 測(cè)試地址
    var testApi = "https://ipinfo.io"
    
    func main() {
        go httpProxy(proxyServer, account, password)
        go Socks5Proxy(proxyServer, account, password)
    
        time.Sleep(time.Minute)
    }
    
    // http代理
    func httpProxy(proxyUrl, user, pass string) {
        defer func() {
            if err := recover(); err != nil {
                fmt.Println(time.Now().Format("2006-01-02 15:04:05 07"), "http", "response:", err)
            }
        }()
        urli := url.URL{}
    
        if !strings.Contains(proxyUrl, "http") {
            proxyUrl = fmt.Sprintf("http://%s", proxyUrl)
        }
    
        urlProxy, _ := urli.Parse(proxyUrl)
        if user != "" && pass != "" {
            urlProxy.User = url.UserPassword(user, pass)
        }
    
        client := &http.Client{
            Transport: &http.Transport{
                Proxy: http.ProxyURL(urlProxy),
            },
        }
        rqt, err := http.NewRequest("GET", testApi, nil)
        if err != nil {
            panic(err)
            return
        }
        response, err := client.Do(rqt)
        if err != nil {
            panic(err)
            return
        }
    
        defer response.Body.Close()
        body, _ := ioutil.ReadAll(response.Body)
        fmt.Println(time.Now().Format("2006-01-02 15:04:05 07"), proxyUrl, "【http success】", "response:", response.Status, string(body))
    
        return
    }
    
    // socks5代理
    func Socks5Proxy(proxyUrl, user, pass string) {
    
        defer func() {
            if err := recover(); err != nil {
                fmt.Println(time.Now().Format("2006-01-02 15:04:05 07"), proxyUrl, "response:", err)
            }
        }()
    
        var userAuth proxy.Auth
        if user != "" && pass != "" {
            userAuth.User = user
            userAuth.Password = pass
        }
        dialer, err := proxy.SOCKS5("tcp", proxyUrl, &userAuth, proxy.Direct)
        if err != nil {
            panic(err)
        }
        httpClient := &http.Client{
            Transport: &http.Transport{
                DialContext: func(ctx context.Context, network, addr string) (conn net.Conn, err error) {
                    return dialer.Dial(network, addr)
                },
            },
            Timeout: time.Second * 10,
        }
    
        if resp, err := httpClient.Get(testApi); err != nil {
            panic(err)
        } else {
            defer resp.Body.Close()
            body, _ := ioutil.ReadAll(resp.Body)
            fmt.Println(time.Now().Format("2006-01-02 15:04:05 07"), proxyUrl, "【socks5 success】", "response:", string(body))
        }
    }                                
                            
                        
                            
    package demo;

    import okhttp3.Credentials;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    
    import java.io.IOException;
    import java.net.InetSocketAddress;
    import java.net.PasswordAuthentication;
    import java.net.Proxy;
    
    /**
        * compile 'com.squareup.okhttp3:okhttp:4.9.3'
        */
    class AutProxyJava {
        public static void main(String[] args) throws IOException {
            testWithOkHttp();
    
            testSocks5WithOkHttp();
        }
    
        /**
            * http代理
            */
        public static void testWithOkHttp() throws IOException {
            String url = "https://ipinfo.io";//請(qǐng)求地址
            //創(chuàng)建一個(gè)HTTP類(lèi)型的代理對(duì)象,指定代理服務(wù)器的主機(jī)名和端口號(hào)
            Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("host", "port"));//這里用到的"host"和"port"應(yīng)替換為代理服務(wù)器地址和端口。
            // 構(gòu)建一個(gè)自定義的OkHttpClient實(shí)例,設(shè)置代理服務(wù)器并添加一個(gè)代理認(rèn)證器(proxyAuthenticator):
            OkHttpClient client = new OkHttpClient().newBuilder().proxy(proxy).proxyAuthenticator((route, response) -> {
                // 在這里生成Basic認(rèn)證的憑證字符串
                String credential = Credentials.basic("account", "password");//此處的賬號(hào)密碼 "account" 和 "password" 應(yīng)替換為認(rèn)證賬戶(hù)名和認(rèn)證賬戶(hù)密碼。
                // 如果代理服務(wù)器需要身份驗(yàn)證,則在請(qǐng)求頭中添加認(rèn)證信息
                return response.request().newBuilder()
                        .header("Proxy-Authorization", credential)
                        .build();
            }).build();
    
            //發(fā)送GET請(qǐng)求并獲取響應(yīng):
            Request request = new Request.Builder().url(url).build();
            okhttp3.Response response = client.newCall(request).execute();
            //獲取并打印響應(yīng)內(nèi)容:
            String responseString = response.body().string();
            System.out.println(responseString);
        }
    
        /**
            * Socks5代理
            */
        public static void testSocks5WithOkHttp() throws IOException {
            //請(qǐng)求地址
            String url = "https://ipinfo.io";
            //創(chuàng)建一個(gè)SOCKS類(lèi)型的代理對(duì)象,設(shè)置實(shí)際的代理服務(wù)器主機(jī)名和端口號(hào):
            Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("host", "port"));//這里用到的"host"和"port"應(yīng)替換為代理服務(wù)器地址和端口。
            //設(shè)置全局默認(rèn)的認(rèn)證器(Authenticator),用于處理所有網(wǎng)絡(luò)連接需要的基本身份驗(yàn)證。這里預(yù)設(shè)了一個(gè)用戶(hù)名和密碼:
            java.net.Authenticator.setDefault(new java.net.Authenticator() {
                private PasswordAuthentication authentication =
                        new PasswordAuthentication("account", "password".toCharArray());//此處的賬號(hào)密碼 "account" 和 "password" 應(yīng)替換為認(rèn)證賬戶(hù)名和認(rèn)證賬戶(hù)密碼。
    
                @Override
                protected PasswordAuthentication getPasswordAuthentication() 
            });
            //構(gòu)建OkHttpClient實(shí)例,配置好SOCKS代理:
            OkHttpClient client = new OkHttpClient().newBuilder().proxy(proxy).build();
            //發(fā)送GET請(qǐng)求并獲取響應(yīng):
            Request request = new Request.Builder().url(url).build();
            okhttp3.Response response = client.newCall(request).execute();
            //獲取并打印響應(yīng)內(nèi)容:
            String responseString = response.body().string();
            System.out.println(responseString);
        }
    }
                            
                        
                            
    // demo.cpp : 定義控制臺(tái)應(yīng)用程序的入口點(diǎn)。
    //
    
    #include "stdafx.h"
    #include "curl/curl.h"
    #pragma comment(lib, "libcurl.lib")
    //curl 回調(diào)函數(shù)
    static size_t write_buff_data(char *buffer, size_t size, size_t nitems, void *outstream)
    {
        memcpy(outstream, buffer, nitems*size);
        return nitems*size;
    }
    
    /*
    使用http代理
    */
    int GetUrlHTTP(char *url, char *buff)
    {
        CURL *curl;
        CURLcode res;
        curl = curl_easy_init();
        if (curl)
        {
            curl_easy_setopt(curl, CURLOPT_PROXY,"http://代理服務(wù)器地址:端口");//設(shè)置http代理地址
            curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, "認(rèn)證賬戶(hù)名:認(rèn)證賬戶(hù)密碼");//認(rèn)證賬戶(hù)名及密碼,以":"分隔
            curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)buff);//設(shè)置讀寫(xiě)緩存
            curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_buff_data);//設(shè)置回調(diào)函數(shù)
            curl_easy_setopt(curl, CURLOPT_URL, url);//設(shè)置url地址
            curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 10L);//設(shè)置一個(gè)長(zhǎng)整形數(shù),控制多少秒傳送CURLOPT_LOW_SPEED_LIMIT規(guī)定的字節(jié)數(shù)
            curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 50L);//設(shè)置一個(gè)長(zhǎng)整形數(shù),控制傳送多少字節(jié)
            curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, 2000000L);//下載最高速度
    
            res = curl_easy_perform(curl);
            curl_easy_cleanup(curl);
            if (res == CURLE_OK){
                return res;
            }else {
                printf("錯(cuò)誤代碼:%d\n", res);
                MessageBox(NULL, TEXT("獲取IP錯(cuò)誤"), TEXT("助手"), MB_ICONINFORMATION | MB_YESNO);
            }
        }
        return res;
    }
    /*
    使用socks5代理
    */
    int GetUrlSocks5(char *url, char *buff)
    {
        CURL *curl;
        CURLcode res;
        curl = curl_easy_init();
        if (curl)
        {
            curl_easy_setopt(curl, CURLOPT_PROXY, "socks5://代理服務(wù)器地址:端口");//設(shè)置socks5代理地址
            curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, "認(rèn)證賬戶(hù)名:認(rèn)證賬戶(hù)密碼");//認(rèn)證賬戶(hù)名及密碼,以":"分隔
            curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)buff);//設(shè)置讀寫(xiě)緩存
            curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_buff_data);//設(shè)置回調(diào)函數(shù)
            curl_easy_setopt(curl, CURLOPT_URL, url);//設(shè)置url地址
            curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 10L);//設(shè)置一個(gè)長(zhǎng)整形數(shù),控制多少秒傳送CURLOPT_LOW_SPEED_LIMIT規(guī)定的字節(jié)數(shù)
            curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 50L);//設(shè)置一個(gè)長(zhǎng)整形數(shù),控制傳送多少字節(jié);
            curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, 2000000L);/*下載最高速度*/
            res = curl_easy_perform(curl);
            curl_easy_cleanup(curl);
            if (res == CURLE_OK) {
                return res;
            }
            else {
                printf("錯(cuò)誤代碼:%d\n", res);
                MessageBox(NULL, TEXT("獲取IP錯(cuò)誤"), TEXT("助手"), MB_ICONINFORMATION | MB_YESNO);
            }
        }
        return res;
    }
    /*
    不使用代理
    */
    int GetUrl(char *url, char *buff)
    {
        CURL *curl;
        CURLcode res;
        //使用的curl庫(kù) 初始化curl庫(kù)
        curl = curl_easy_init();
        if (curl)
        {
            curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)buff);//設(shè)置讀寫(xiě)緩存
            curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_buff_data);//設(shè)置回調(diào)函數(shù)
            curl_easy_setopt(curl, CURLOPT_URL, url);//設(shè)置url地址
            curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 10L);//設(shè)置一個(gè)長(zhǎng)整形數(shù),控制多少秒傳送CURLOPT_LOW_SPEED_LIMIT規(guī)定的字節(jié)數(shù)
            curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 50L);//設(shè)置一個(gè)長(zhǎng)整形數(shù),控制傳送多少字節(jié)
            curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, 2000000L);/*下載最高速度*/
            res = curl_easy_perform(curl);
            curl_easy_cleanup(curl);
            if (res == CURLE_OK)
            {
                return res;
            }
            else {
                printf("錯(cuò)誤代碼:%d\n", res);
                MessageBox(NULL, TEXT("獲取IP錯(cuò)誤"), TEXT("助手"), MB_ICONINFORMATION | MB_YESNO);
            }
        }
        return res;
    }
    int main()
    {
        char *buff=(char*)malloc(1024*1024);
        memset(buff, 0, 1024 * 1024);
        //不使用http代理
        GetUrl("http://myip.top", buff);
        printf("不使用代理:%s\n", buff);
        //使用http代理
        memset(buff, 0, 1024 * 1024);
        GetUrlHTTP("http://ipinfo.io", buff);
        printf("http結(jié)果:%s\n", buff);
        //使用socks5代理
        memset(buff, 0,1024 * 1024);
        GetUrlSocks5("http://ipinfo.io", buff);
        printf("socks5結(jié)果:%s\n", buff);
    
        free(buff);
        Sleep(10 * 1000);//等待10秒退出
        
        return 0;
    }
                            
                        

純凈動(dòng)態(tài)住宅

獨(dú)享靜態(tài)IP

流量不過(guò)期

城市級(jí)定位

無(wú)限并發(fā)

支持HTTP(S)/Socks5協(xié)議