Company intranet environment Access outside the network needs through proxy, MMS interface in the external network environment has been transferred, how to access the network through the Curl Access Proxy Server
Source: Internet
Author: User
Company intranet environment Access outside the network needs through the agent, MMS interface in the external environment has been transferred, how to access the network through the Curl Access Proxy Server
Title, MMS interface in the external network state has been transferred, but the company uses the intranet, need to go Proxy server to access the external network, MMS interface is via curl post to the specified address.
$url = ' Http://122.200.77.96/sendMMS ';
$header [] = "Content-type:text/xml";
$ch = Curl_init ($url);
curl_setopt ($ch, Curlopt_url, $url);
curl_setopt ($ch, Curlopt_returntransfer, true);
curl_setopt ($ch, Curlopt_httpheader, $header);
curl_setopt ($ch, Curlopt_post, 1);
curl_setopt ($ch, Curlopt_postfields, $xmlData);
$response = curl_exec ($ch);
if (Curl_errno ($ch)) {
Print Curl_error ($ch);
}
Curl_close ($ch);
This is the post to the MMS interface code, how to go through the proxy Server curl, and then post to the specified interface
------Solution--------------------
curl_setopt ($ch, Curlopt_proxy, $this->data[' PROXY ');
curl_setopt ($ch, Curlopt_httpproxytunnel, 1);
With these two, but obviously, I can't get my own local frustration.
------Solution--------------------
curl_setopt ($ch, Curlopt_proxy, "Proxy server address: port");
curl_setopt ($ch, Curlopt_proxyuserpwd, "Username: password"); No, don't say that.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.