1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 09:27:35 +00:00

LibCore+RequestServer: Add support for SOCKS5 proxies

This commit is contained in:
Ali Mohammad Pur 2022-04-06 04:14:18 +04:30 committed by Andreas Kling
parent bd5403adf1
commit cd9d740107
6 changed files with 470 additions and 15 deletions

View file

@ -0,0 +1,31 @@
/*
* Copyright (c) 2022, Ali Mohammad Pur <mpfard@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Error.h>
#include <AK/Types.h>
#include <LibIPC/Forward.h>
namespace Core {
// FIXME: Username/password support.
struct ProxyData {
enum Type {
Direct,
SOCKS5,
} type { Type::Direct };
u32 host_ipv4 { 0 };
int port { 0 };
bool operator==(ProxyData const& other) const = default;
};
}
namespace IPC {
bool encode(Encoder&, Core::ProxyData const&);
ErrorOr<void> decode(Decoder&, Core::ProxyData&);
}