previousリクエストヘッダ (Previous) (Next) レスポンスの評価next

View this page in Last updated: Sun, 21 Jun 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

プロキシ認証

プロキシ認証 – HTTP プロキシを利用する

プロキシ認証の使用方法

匿名アクセスでプロキシサーバを利用する

この例では、プロキシサーバがポート 8080 で待機しており、 example.com への外向き接続の代理(プロキシ)を行っている proxy.example.com というホスト名のマシンを 利用しようとしている、と想定しています。

setProxy() の二番目のパラメータはオプションで、 デフォルトは 8080 です。

<?php
require_once "HTTP/Request.php";

$req =& new HTTP_Request("http://example.com/");
$req->setProxy("proxy.example.com"8080);
?>

プロキシ認証の利用

これは、プロキシサーバでのユーザー認証のためのユーザー名/パスワードの タプルが提供されていることを除いて、上記と同じ例です: ユーザー名は johndoe で付随するパスワードは foo です。

<?php
require_once "HTTP/Request.php";

$req =& new HTTP_Request("http://example.com/");
$req->setProxy("proxy.example.com"8080"johndoe""foo");
?>
previousリクエストヘッダ (Previous) (Next) レスポンスの評価next

Download Documentation Last updated: Sun, 21 Jun 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.