Client(http) <-> yarp(reverseProxy) <-> pproxy(http) <-> tor(socks5)
i have tor proxy server with socks5 protocol and use pproxy for send http request to socks5
i want forwarding yarp http request -> pproxy -> to tor
is it possible? or no
yarp-program config:
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddReverseProxy()
.LoadFromConfig(builder.Configuration.GetSection("ReverseProxy"));
var app = builder.Build();
if (app.Environment.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.MapReverseProxy();
app.Map("/", () =>
{
return "Yarp is working...";
});
app.Run();
yarp-appsetting.json:
{
"ReverseProxy": {
"Routes": {
"r0": {
"ClusterId": "accountApi-cluster",
"Match": {
"Path": "{**catch-all}"
}
}
},
"Clusters": {
"accountApi-cluster": {
"Destinations": {
"d0": {
"Address": "http://192.168.1.2:8070"
}
}
}
}
}
}
pproxy- script:
pproxy -l http://0.0.0.0:8070 -ur socks5://127.0.0.1:9100
yarp- exception log:
info: Yarp.ReverseProxy.Forwarder.HttpForwarder[9]
Proxying to http://192.168.1.2:8070/api HTTP/2 RequestVersionOrLower
warn: Yarp.ReverseProxy.Forwarder.HttpForwarder[48]
RequestCanceled: The request was canceled before receiving a response.
System.Threading.Tasks.TaskCanceledException: The operation was canceled.
---> System.IO.IOException: Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request..
---> System.Net.Sockets.SocketException (995): The I/O operation has been aborted because of either a thread exit or an application request.
--- End of inner exception stack trace ---
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16 token)
at System.Net.Http.HttpConnection.InitialFillAsync(Boolean async)
at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpMessageInvoker.<SendAsync>g__SendAsyncWithTelemetry|6_0(HttpMessageHandler handler, HttpRequestMessage request, CancellationToken cancellationToken)
at Yarp.ReverseProxy.Forwarder.HttpForwarder.SendAsync(HttpContext context, String destinationPrefix, HttpMessageInvoker httpClient, ForwarderRequestConfig requestConfig, HttpTransformer transformer, CancellationToken cancellationToken)