ドッカーコンテナのプロキシHTTPリクエストで実行されているWeb APIからhttpコールを取得するのは難しいです。私は今、私は私が試したのと同じコンテナドッカーのコンテナで実行されているdotnetコアアプリケーションからのすべてのリクエストをプロキシするにはどうすればいいですか?
上で実行されているアプリの中からこれを再作成したいのbash
docker exec -i -t 665b4a1e17b6 /bin/bash
と
http_proxy=http://exampleProxy:7777 curl -s http://endpoint
を使用してプロキシが希望するエンドポイントを成功裏に達しました次
- HttpClientHandler
var handler = new HttpClientHandler { Proxy = new WebProxy("http://example:777) }; var client = new HttpClient(handler); etc....
を使用して、コンテナの作成時にHTTP_PROXY環境変数
export http_proxy=http://example:7777
を設定
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();
app.UseMvc().RunProxy(new ProxyOptions
{
Scheme = "http",
Host = "example",
Port = "7777"
});
誰もがプロキシを設定する他の方法を考えることができますか?またはこれをデバッグする方法に関する助言?