forked from envoyproxy/envoy-filter-example
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathecho2.h
More file actions
27 lines (21 loc) · 698 Bytes
/
echo2.h
File metadata and controls
27 lines (21 loc) · 698 Bytes
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
#pragma once
#include "envoy/network/filter.h"
#include "common/common/logger.h"
namespace Envoy {
namespace Filter {
/**
* Implementation of a basic echo filter.
*/
class Echo2 : public Network::ReadFilter, Logger::Loggable<Logger::Id::filter> {
public:
// Network::ReadFilter
Network::FilterStatus onData(Buffer::Instance& data, bool end_stream) override;
Network::FilterStatus onNewConnection() override { return Network::FilterStatus::Continue; }
void initializeReadFilterCallbacks(Network::ReadFilterCallbacks& callbacks) override {
read_callbacks_ = &callbacks;
}
private:
Network::ReadFilterCallbacks* read_callbacks_{};
};
} // namespace Filter
} // namespace Envoy