價錢
語言
價錢
Socks5 代理
獲取代理
解決方案
資源
********
個人中心
登出
反饋
訪問幫助中心
類型*
所需功能
技術錯誤
推薦的優化
其他的
詳細說明*
聯繫方式*
電子郵件
Use mobile phone to scan and download APP
賬密認證,在Http代理中常用的提取方式,
不同於SOCKS5需要下載用戶端,選擇具體IP等多步驟繁瑣操作
賬密認證僅需要用戶註冊帳號,購買對應套餐的IP類型,選擇您需要的國家,購買和使用均可以在我們的官方網站操作,而無須下載任何軟件,隨取隨用,更加輕便高效。
*注意:現在我們只支持ISP類型的IP進行賬密認證的方式提取。 如果您需要使用此方式,請購買ISP類型的IP
賬密認證提取適用於各種業務場景。 常見的業務方向包括網絡資訊數據爬蟲抓取、網絡資訊安全與保護、跨境電商等。
爬蟲信息抓取
信息安全與防禦
跨境電子商務
進入賬密認證頁面,我們將根據您的ID為您生成默認用戶名和密碼,並支持您修改密碼。
選擇對應的地區和對應的協議類型,生成需要的代理鏈接。
參數說明
演示
參數說明
#include iostream
#include stdio.h
#include string
#include Windows.h
#include "curl/curl.h"
#pragma comment(lib, "libcurl.lib")
using namespace std;
static size_t write_buff_data(char* buffer, size_t size, size_t nitems, void* outstream)
{//Copy the received data to the cache
memcpy(outstream, buffer, nitems * size);
return nitems * size;
}
/*
Use HTTP proxy
*/
int GetUrlHTTP(char* url, char* buff)
{
CURL* curl;
CURLcode res;
curl = curl_easy_init();
if (curl)
{
curl_easy_setopt(curl, CURLOPT_PROXY, "http://ip:port");//Set HTTP proxy address
curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, "User name: password");//Proxy username password
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)buff);//Set Read-Write Cache
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_buff_data);//Set Callback Function
curl_easy_setopt(curl, CURLOPT_URL, url);//Set URL address
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 10L);//Sets a long integer to control how many seconds CURLOPT_LOW_SPEED_LIMIT bytes are passed
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 50L);//Set a long integer to control how many bytes are transferred
curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, 2000000L);//Maximum download speed
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
if (res == CURLE_OK) {
return res;
}
else {
printf("error code:%d\n", res);
MessageBox(NULL, TEXT("Get IP Error"), TEXT("assistant"), MB_ICONINFORMATION | MB_YESNO);
}
}
return res;
Problems? Contact us
package main
import (
"context"
"fmt"
"golang.org/x/net/proxy"
"io/ioutil"
"net"
"net/http"
"net/url"
"strings"
"time"
)
var testApi = "https://api.ipify.org/?format=json"
func main() {
var proxyIP = "922s5.proxys5.net:6300"
var username = "xxx-zone-isp"
var password = ""
httpProxy(proxyIP, username, password)
time.Sleep(time.Second * 1)
Socks5Proxy(proxyIP, username, password)
}
func httpProxy(proxyUrl, user, pass string) {
defer func() {
if err := recover(); err != nil {
fmt.Println(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("http result = ", response.Status, string(body))
return
}
func Socks5Proxy(proxyUrl, user, pass string) {
defer func() {
if err := recover(); err != nil {
fmt.Println(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("socks5 result = ",string(body))
}
}
Problems? Contact us
#!/usr/bin/env node
require('request-promise')({
url: 'https://ipinfo.io',
proxy: 'http://???-zone-custom:????@ ',
})
.then(function(data){ console.log(data); },
function(err){ console.error(err); });
Problems? Contact us
<?php
$targetUrl = "https://www.google.com/";
$proxyServer = "http://922s5.proxys5.net:6300";
$proxyUserPwd = "user:psswd";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $targetUrl);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_PROXYTYPE, 0); //http
// curl_setopt($ch, CURLOPT_PROXYTYPE, 5); //sock5
curl_setopt($ch, CURLOPT_PROXY, $proxyServer);
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);
Problems? Contact us
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:3.10.0'
*/
class AutProxyJava {
public static void main(String[] args) throws IOException {
testWithOkHttp();
testSocks5WithOkHttp();
}
public static void testWithOkHttp() throws IOException {
String url = "https://api.ipify.org?format=json";
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("ip.proxys5.net", 6500));
OkHttpClient client = new OkHttpClient().newBuilder().proxy(proxy).proxyAuthenticator((route, response) -> {
String credential = Credentials.basic("username-zone-custom", password);
return response.request().newBuilder()
.header("Proxy-Authorization", credential).build();
}).build();
Request request = new Request.Builder().url(url).build();
okhttp3.Response response = client.newCall(request).execute();
String responseString = response.body().string();
System.out.println(responseString);
}
public static void testSocks5WithOkHttp() throws IOException {
String url = "https://api.ipify.org?format=json";
Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("ip.proxys5.net", 6500));
java.net.Authenticator.setDefault(new java.net.Authenticator() {
private PasswordAuthentication authentication =
new PasswordAuthentication("laylay-zone-isp", "123456".toCharArray());
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return authentication;
}
});
OkHttpClient client = new OkHttpClient().newBuilder().proxy(proxy).build();
Request request = new Request.Builder().url(url).build();
okhttp3.Response response = client.newCall(request).execute();
String responseString = response.body().string();
System.out.println(responseString);
}
}
Problems? Contact us
import urllib
import socks
import http.client
from urllib.error import URLError
import ssl
from urllib.request import build_opener, HTTPHandler, HTTPSHandler
def merge_dict(a, b):
d = a.copy()
d.update(b)
return d
class SocksiPyConnection(http.client.HTTPConnection):
def __init__(self, proxytype, proxyaddr, proxyport=None, rdns=True, username=None, password=None, *args, **kwargs):
self.proxyargs = (proxytype, proxyaddr, proxyport, rdns, username, password)
http.client.HTTPConnection.__init__(self, *args, **kwargs)
def connect(self):
self.sock = socks.socksocket()
self.sock.setproxy(*self.proxyargs)
if type(self.timeout) in (int, float):
self.sock.settimeout(self.timeout)
self.sock.connect((self.host, self.port))
class SocksiPyConnectionS(http.client.HTTPSConnection):
def __init__(self, proxytype, proxyaddr, proxyport=None, rdns=True, username=None, password=None, *args, **kwargs):
self.proxyargs = (proxytype, proxyaddr, proxyport, rdns, username, password)
http.client.HTTPSConnection.__init__(self, *args, **kwargs)
def connect(self):
sock = socks.socksocket()
sock.setproxy(*self.proxyargs)
if type(self.timeout) in (int, float):
sock.settimeout(self.timeout)
sock.connect((self.host, self.port))
self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file)
class SocksiPyHandler(HTTPHandler, HTTPSHandler):
def __init__(self, *args, **kwargs):
self.args = args
self.kw = kwargs
HTTPHandler.__init__(self)
def http_open(self, req):
def build(host, port=None, timeout=0, **kwargs):
kw = merge_dict(self.kw, kwargs)
conn = SocksiPyConnection(*self.args, host=host, port=port, timeout=timeout, **kw)
return conn
return self.do_open(build, req)
def https_open(self, req):
def build(host, port=None, timeout=0, **kwargs):
kw = merge_dict(self.kw, kwargs)
conn = SocksiPyConnectionS(*self.args, host=host, port=port, timeout=timeout, **kw)
return conn
return self.do_open(build, req)
username = ""
password = ""
ip = "ip.proxys5.net"
port = 6500
proxy = "socks5://{username}:{password}@{ip}:{port}".format(username=username, password=password, ip=ip, port=port)
# socks.set_default_proxy(socks.SOCKS5, ip, port,username=username,password=password)
# socket.socket = socks.socksocket
url = 'https://www.google.com/'
try:
req = urllib.request.Request(url=url, headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36'})
opener = build_opener(SocksiPyHandler(socks.SOCKS5, ip, port, username=username, password=password))
response = opener.open(req)
# response = urllib.request.urlopen(req)
# response = request.urlopen(url)
print(response.read().decode('utf-8'))
except URLError as e:
print(e)
合夥
© Copyright 2024 922Proxy.com. All rights reserved.