Consume Void::Net directly in NetworkClient and callers
Delete NetworkClient's to_void_method/to_void_proxy/to_api_response bridge and the Api::RetryConfig member; the client builds Void::Net::Request, sends via Void::Net::HttpClient, returns Void::Net::Response, and retries via an internal Void::Retry policy + retryable-status list. Call sites updated to Void::Net member names: isSuccess()->ok(), statusCode->status, getHeader()->header() (optional<string_view>), isRedirect()->status range check; proxy isValid()->enabled(), requiresAuth()->has_auth(), isSocks5()->kind == Kind::Socks5. Proxy fields flow through YtDlpManager/AudioDecoder/MusicManager unchanged in spelling. On-disk proxy shape is now Void::Net::ProxyConfig (kind: None/Http/Socks5); config.example.json updated and proxy round-trip verified. Build green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
3af9aecbec
commit
9d56a6ff01
12 files changed
+158
-223
No files matched your search
@@ -152,13 +152,13 @@ namespace Echoion::Core
|
||||
av_dict_set(&options, "analyzeduration", "20000000", 0);
|
||||
av_dict_set(&options, "probesize", "10240000", 0);
|
||||
|
||||
if (proxyConfig_.has_value() && proxyConfig_->isValid()) {
|
||||
if (proxyConfig_.has_value() && proxyConfig_->enabled()) {
|
||||
std::string proxyUrl;
|
||||
if (proxyConfig_->isSocks5()) {
|
||||
if ((proxyConfig_->kind == Void::Net::ProxyConfig::Kind::Socks5)) {
|
||||
// Use standard socks5:// scheme. FFmpeg http protocol handles
|
||||
// this correctly. socks5h:// is often rejected by the http
|
||||
// protocol handler, causing proxy bypass.
|
||||
if (proxyConfig_->requiresAuth()) {
|
||||
if (proxyConfig_->has_auth()) {
|
||||
proxyUrl = std::format(
|
||||
"socks5://{}:{}@{}:{}", *proxyConfig_->username,
|
||||
*proxyConfig_->password, proxyConfig_->host,
|
||||
@@ -168,7 +168,7 @@ namespace Echoion::Core
|
||||
proxyConfig_->port);
|
||||
}
|
||||
} else {
|
||||
if (proxyConfig_->requiresAuth()) {
|
||||
if (proxyConfig_->has_auth()) {
|
||||
proxyUrl = std::format(
|
||||
"http://{}:{}@{}:{}", *proxyConfig_->username,
|
||||
*proxyConfig_->password, proxyConfig_->host,
|
||||
@@ -491,7 +491,7 @@ namespace Echoion::Core
|
||||
}
|
||||
|
||||
void AudioDecoder::setProxyConfig(
|
||||
const std::optional<Api::ProxyConfig>& proxy)
|
||||
const std::optional<Void::Net::ProxyConfig>& proxy)
|
||||
{
|
||||
proxyConfig_ = proxy;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user