Remote address

13 views
Skip to first unread message

Sweetdreams

unread,
Apr 8, 2015, 11:34:20 AM4/8/15
to guz...@googlegroups.com
Hi,
Is possible send/inject client IP address?
pls give me small example how define this property.

thx

Douglas Gough

unread,
Apr 8, 2015, 12:54:49 PM4/8/15
to guz...@googlegroups.com
Can you give a more detailed example of what you're trying to accomplish?

Thanks
Message has been deleted

Sweetdreams

unread,
Apr 8, 2015, 2:59:11 PM4/8/15
to guz...@googlegroups.com
i try instruction from http://guzzle.readthedocs.org/en/latest/overview.html

Task:
- user has IP : 80.0.0.1
- server with guzzle has IP: 90.0.0.20
if is possible, I need restful server give request with user IP(80.0.0.1) no client server IP(90.0.0.20)

in this documentation (https://github.com/guzzle/ringphp/blob/master/docs/spec.rst#server-specific-options) exist "remote_addr" i dont know how use it :/

and now example:

                        use \GuzzleHttp\Client;
$ip = '80.0.0.1'; 
$client = new Client([
'base_url' => ['https://restapi.com/{version}/', ['version' => 'v5.4']],
'defaults' => [
'headers' => [
'Accept' => 'application/json'
],
]
]);
$auth = $client->post('auth', [
'body' => [
'username' => 'username',
'password' => 'password']
])->json();
Reply all
Reply to author
Forward
0 new messages