Skip to content

Commit

Permalink
Add documentation on using proxies
Browse files Browse the repository at this point in the history
  • Loading branch information
ozh authored and rmccue committed Sep 10, 2013
1 parent 4e7dd91 commit f5e1aa3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/README.md
Expand Up @@ -15,6 +15,7 @@ here are prose; you might also want to check out the [API documentation][].
* [Authenticating your request][authentication]
* Advanced Usage
* [Custom authentication][authentication-custom]
* [Requests through proxy][proxy]
* [Hooking system][hooks]

[goals]: goals.md
Expand All @@ -23,4 +24,5 @@ here are prose; you might also want to check out the [API documentation][].
[usage-advanced]: usage-advanced.md
[authentication]: authentication.md
[authentication-custom]: authentication-custom.md
[hooks]: hooks.md
[hooks]: hooks.md
[proxy]: proxy.md
23 changes: 23 additions & 0 deletions docs/proxy.md
@@ -0,0 +1,23 @@
Proxy Support
=============

You can easily make requests through HTTP proxies.

To make requests through an open proxy, specify the following options:

```php
$options = array(
'proxy' => '127.0.0.1:3128'
);
Requests::get('http://httpbin.org/ip', array(), $options);
```

If your proxy needs you to authenticate, the option will become an array like
the following:

```php
$options = array(
'proxy' => array( '127.0.0.1:3128', 'my_username', 'my_password' )
);
Requests::get('http://httpbin.org/ip', array(), $options);
```

0 comments on commit f5e1aa3

Please sign in to comment.