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:
parent
bd5403adf1
commit
cd9d740107
6 changed files with 470 additions and 15 deletions
31
Userland/Libraries/LibCore/Proxy.h
Normal file
31
Userland/Libraries/LibCore/Proxy.h
Normal 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&);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue