当前位置:网站首页>PHP curl 请求中设置 proxy 方法
PHP curl 请求中设置 proxy 方法
2022-07-22 09:54:00 【xchenhao】
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.google.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // 信任任何证书
curl_setopt($ch, CURLOPT_PROXY, "127.0.0.1");
curl_setopt($ch, CURLOPT_PROXYPORT, "10809");
// curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); // CURLPROXY_SOCKS5
// curl_setopt($ch, CURLOPT_PROXYUSERPWD, "username:password");
$output = curl_exec($ch);
var_export($output);
var_export(curl_error($ch));
curl_close($ch);
- 参考
https://blog.csdn.net/mypowerhere/article/details/97260758PHP 使用 CURL 配置代理
https://blog.csdn.net/qq_38191191/article/details/82771869php curl 实现发送 get和 post 请求
https://blog.csdn.net/u012382791/article/details/51408523PHP 笔记:后台get和post带参请求的封装
https://www.libaocai.com/6958.htmlphp SSL certificate problem: unable to get local issuer certificate 解决办法
https://www.it1352.com/2024852.html在 Guzzle 中设置代理(Set proxy in Guzzle)
边栏推荐
- Go 中的基础库Time时间处理
- Preface of daily column
- Force deduction solution summary 498 diagonal traversal
- Markdown数学公式语法
- Day5:构造程序逻辑
- el-table获取当前行index的方法
- [Standard Specification] what is the concept and definition of low code? Is no code a low code?
- Force deduction solution summary 1200 minimum absolute difference
- Terminal data protection of Internet communication security
- 关于红队方面的学习资料
猜你喜欢
随机推荐
2022版Centos8 yum镜像安装&阿里云安装Mysql 5.7教程与问题解决
Research on the principle of Tencent persistence framework mmkv
Pytest interface automated testing framework | why do you want to do the secondary development of pytest plug-ins
7.18 正方形数组的数目
grafana面板-覆盖字段值
各种 XSS Payload 速查清单
4G工业路由器大气环境监测方案
问一下,我用flinkCDC读取MySQL的binlog为什么datetime类型字段会早8个小时?
In his early 30s, he became a doctoral director of Fudan University. Chen Siming: I want to write both codes and poems
最强屏幕工具ShareX v14.0.1
[take you to learn C, take you to fly] branch structure in Chapter 3 of C language programming (3rd Edition) of Zhejiang University Edition (exercise 3)
7.19 二叉树
Force deduction solution summary 745 prefix and suffix search
Why does additional currency issue cause inflation? How to cause
Force deduction solution summary 676- realize a magic dictionary
Glibc source code analysis
Pytest interface automated testing framework | pytest parameterization
Jackson parsing JSON detailed tutorial
敏捷 ? DevOps ?
【commons-beanutils专题】004- BeanUtils 专题