Welcome Guest, Not a member yet? Register   Sign In
CI Proxy Library - Browser simulator (REST, Cookies and Proxy Support, PURE PHP) [NEW] HTTP Authorization
#31

[eluser]toopay[/eluser]
Updated to V 1.0.7

Just added set_http function, for more flexible way to perform an http calls.

Code:
// An example of DELETE, with custom HTTP header (like API Key, or anything else) by setting HTTP params (it should be an array!)
$this->proxy->set_http(array(
        'head' => array('X-API-KEY' => 'fooandbarnotencrypted'),
        'body' => array('id' => 1),
    )
);
// Now you have a simple and short line here...
echo $this->proxy->http('DELETE','api.yourdomain.com/api/users');
#32

[eluser]Unknown[/eluser]
Could this library send email behind the proxy?

I try to code like this:
class Email extends Controller {
function Email(){
parent::Controller();
$this->load->library('email');
$this->load->library('proxy');
}
function index()
{
$this->proxy->set_proxy('proxies.*****.co.id',8080,'***@***.co.id','password');
$hasil=$this->proxy->controller('email/send_email', TRUE);
echo $hasil;
}
function send_email()
{
$this->email->set_newline("\r\n");
$this->email->from('*****@gmail.com');
$this->email->to("*****@gmail.com");
$this->email->subject('A test email from CodeIgniter using Gmail');
$this->email->message("I can now email from CodeIgniter using Gmail as my server!");
if($this->email->send()) {
return "Message sent successfully!";
}
else {
return "Fail to send your message!!";
}
}
}
But nothing happen, if i run this code outside the proxy, the code function send_mail run smoothly.
Any suggest how to send email behind the proxy?




Theme © iAndrew 2016 - Forum software by © MyBB