1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 20:57:44 +00:00

RequestServer+LibProtocol: Allow users to specify a per-request proxy

This commit is contained in:
Ali Mohammad Pur 2022-04-07 21:10:33 +04:30 committed by Andreas Kling
parent cd9d740107
commit 45867435c4
16 changed files with 52 additions and 24 deletions

View file

@ -8,6 +8,7 @@
#include <AK/URL.h>
#include <LibCore/AnonymousBuffer.h>
#include <LibCore/DateTime.h>
#include <LibCore/Proxy.h>
#include <LibIPC/Decoder.h>
#include <LibIPC/Dictionary.h>
#include <LibIPC/File.h>
@ -185,4 +186,14 @@ ErrorOr<void> decode(Decoder& decoder, Core::DateTime& datetime)
return {};
}
ErrorOr<void> decode(Decoder& decoder, Core::ProxyData& data)
{
UnderlyingType<decltype(data.type)> type;
TRY(decoder.decode(type));
data.type = static_cast<Core::ProxyData::Type>(type);
TRY(decoder.decode(data.host_ipv4));
TRY(decoder.decode(data.port));
return {};
}
}