AWS IoT Device SDK C++ v2 1.45.2
AWS IoT Device SDK C++ v2
Loading...
Searching...
No Matches
Socks5.h
Go to the documentation of this file.
1#pragma once
2
7
9
10#include <chrono>
11
12struct aws_socks5_proxy_negotiation_strategy;
13
14namespace Aws
15{
16 namespace Crt
17 {
18 namespace Io
19 {
21
28 {
29 public:
37 {
38 m_username = std::move(username);
39 return *this;
40 }
41
49 {
50 m_password = std::move(password);
51 return *this;
52 }
53
59 const ManagedByteBuffer &getUsername() const noexcept { return m_username; }
60
66 const ManagedByteBuffer &getPassword() const noexcept { return m_password; }
67
68 private:
69 ManagedByteBuffer m_username;
70 ManagedByteBuffer m_password;
71 };
72
78 {
79 public:
80 Socks5ProxyNegotiationStrategy() noexcept = delete;
83 Socks5ProxyNegotiationStrategy &operator=(const Socks5ProxyNegotiationStrategy &rhs) noexcept = delete;
85
87
96 Allocator *allocator = ApiAllocator());
97
107 const Socks5BasicAuthOptions &options,
108 Allocator *allocator = ApiAllocator());
109
117 struct aws_socks5_proxy_negotiation_strategy *get() const { return m_strategy; }
118
119 private:
120 Socks5ProxyNegotiationStrategy(struct aws_socks5_proxy_negotiation_strategy *strategy) noexcept;
121
122 struct aws_socks5_proxy_negotiation_strategy *m_strategy;
123 };
124
129 {
130 public:
140 uint16_t proxyPort,
141 std::shared_ptr<Socks5ProxyNegotiationStrategy> strategy) noexcept;
142 Socks5ProxyOptions(const Socks5ProxyOptions &rhs) noexcept;
146
153 Socks5ProxyOptions &withTimeout(std::chrono::milliseconds timeout) noexcept;
154
160 const Aws::Crt::String &proxyHost() const noexcept { return m_proxyHost; }
161
167 uint16_t proxyPort() const noexcept { return m_proxyPort; }
168
174 std::shared_ptr<Socks5ProxyNegotiationStrategy> strategy() const noexcept { return m_strategy; }
175
181 std::chrono::milliseconds timeout() const noexcept { return m_timeout; }
182
183 private:
184 Aws::Crt::String m_proxyHost;
185 uint16_t m_proxyPort;
186
187 std::shared_ptr<Socks5ProxyNegotiationStrategy> m_strategy;
188
189 std::chrono::milliseconds m_timeout;
190 };
191
192 } // namespace Io
193 } // namespace Crt
194} // namespace Aws
const ManagedByteBuffer & getPassword() const noexcept
Definition Socks5.h:66
Socks5BasicAuthOptions & withPassword(ManagedByteBuffer password) noexcept
Definition Socks5.h:48
const ManagedByteBuffer & getUsername() const noexcept
Definition Socks5.h:59
Socks5BasicAuthOptions & withUsername(ManagedByteBuffer username) noexcept
Definition Socks5.h:36
static std::shared_ptr< Socks5ProxyNegotiationStrategy > newStrategyBasicAuth(const Socks5BasicAuthOptions &options, Allocator *allocator=ApiAllocator())
Definition Socks5.cpp:35
static std::shared_ptr< Socks5ProxyNegotiationStrategy > newStrategyNoAuth(Allocator *allocator=ApiAllocator())
Definition Socks5.cpp:16
struct aws_socks5_proxy_negotiation_strategy * get() const
Definition Socks5.h:117
Definition Socks5.h:129
Socks5ProxyOptions & withTimeout(std::chrono::milliseconds timeout) noexcept
Definition Socks5.cpp:113
uint16_t proxyPort() const noexcept
Definition Socks5.h:167
const Aws::Crt::String & proxyHost() const noexcept
Definition Socks5.h:160
Socks5ProxyOptions & operator=(const Socks5ProxyOptions &rhs)
Definition Socks5.cpp:87
std::chrono::milliseconds timeout() const noexcept
Definition Socks5.h:181
std::shared_ptr< Socks5ProxyNegotiationStrategy > strategy() const noexcept
Definition Socks5.h:174
Socks5ProxyOptions(const Aws::Crt::String &proxyHost, uint16_t proxyPort, std::shared_ptr< Socks5ProxyNegotiationStrategy > strategy) noexcept
Definition Socks5.cpp:66
Definition ByteBufUtils.h:24
#define AWS_CRT_CPP_API
Definition Exports.h:36
Definition Credentials.h:23
Definition Allocator.h:13
std::basic_string< char, std::char_traits< char >, StlAllocator< char > > String
Definition Types.h:45
AWS_CRT_CPP_API Allocator * ApiAllocator() noexcept
Definition Allocator.cpp:24
aws_allocator Allocator
Definition Allocator.h:14
Definition Allocator.h:11
Definition StringView.h:862