forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpassthrough.h
34 lines (27 loc) · 1.11 KB
/
passthrough.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once
#include "envoy/network/connection.h"
#include "envoy/network/transport_socket.h"
#include "common/buffer/buffer_impl.h"
namespace Envoy {
namespace Extensions {
namespace TransportSockets {
class PassthroughSocket : public Network::TransportSocket {
public:
PassthroughSocket(Network::TransportSocketPtr&& transport_socket);
void setTransportSocketCallbacks(Network::TransportSocketCallbacks& callbacks) override;
std::string protocol() const override;
absl::string_view failureReason() const override;
bool canFlushClose() override;
void closeSocket(Network::ConnectionEvent event) override;
Network::IoResult doRead(Buffer::Instance& buffer) override;
Network::IoResult doWrite(Buffer::Instance& buffer, bool end_stream) override;
void onConnected() override;
Ssl::ConnectionInfoConstSharedPtr ssl() const override;
// startSecureTransport method should not be called for this transport socket.
bool startSecureTransport() override { return false; }
protected:
Network::TransportSocketPtr transport_socket_;
};
} // namespace TransportSockets
} // namespace Extensions
} // namespace Envoy