.NET HttpClient · プロキシ設定
.NET HttpClientのプロキシ設定
The HTTP client for C# and the rest of .NET. 下の設定で Eveses の住宅用プールに向けてください。地域指定はユーザー名の中にあるので、国を変えるのに他の設定を触る必要はありません。
proxy.eveses.com:12321 · SOCKS5 は 32325 · 199か国 · $7.35/GB から
注意
The proxy lives on the handler, and `HttpClient` is supposed to be a singleton — but a singleton binds the handler for its lifetime, so a rotating geo needs either `SocketsHttpHandler.PooledConnectionLifetime` or one client per geo.
設定
using System.Net;
var handler = new HttpClientHandler
{
Proxy = new WebProxy("http://proxy.eveses.com:12321")
{
Credentials = new NetworkCredential(
"eveses_user_country-us", "YOUR_PROXY_PASSWORD"),
},
UseProxy = true,
};
// One client per geo; reuse it.
var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(30) };
var body = await client.GetStringAsync("https://target-site.com");.NET HttpClientを触らずに国を変える
ドイツ
eveses_user_country-de30分固定
eveses_user_country-de_session-ab12cd34_lifetime-30m地域とセッションはユーザー名の中にあり、ホストやポートにはありません。国を変えてもこのページの設定はそのままで、書き換えるのは1つの文字列だけです。199か国を指定でき、その多くでは都市・州のトークンも使えます。
よくある質問
.NET HttpClientでプロキシを設定するには?›
proxy.eveses.com に向け、HTTP ならポート12321、SOCKS5 なら32325を使い、Eveses のプロキシ用ユーザー名とパスワードで認証します。正確な書き方は上のスニペットにあります。 The proxy lives on the handler, and `HttpClient` is supposed to be a singleton — but a singleton binds the handler for its lifetime, so a rotating geo needs either `SocketsHttpHandler.PooledConnectionLifetime` or one client per geo.
.NET HttpClientの出口の国を選ぶには?›
ホストを変えるのではなく、ユーザー名に地域トークンを付けます。eveses_user_country-de ならドイツ、eveses_user_country-us なら米国です。この方法で199か国を指定でき、都市や州のトークンでさらに絞れます。.NET HttpClient側の設定はそれ以外何も変わりません。
.NET HttpClientでリクエスト間に同じIPを保つには?›
セッショントークンを足します — eveses_user_country-us_session-ab12cd34_lifetime-30m。このユーザー名を使うリクエストは、有効期間が切れるまで同じアドレスから出ます。トークンを外せば、リクエストごとに新しいIPへローテーションします。
料金は?›
住宅用トラフィックは Eveses ウォレットからGB単位で課金されます。1 GB で$7.35/GB、大容量では$2.57/GB まで下がります。ツールごとの料金はなく、同じ認証情報がすべてのツールで同時に使えます。