Niels Möller | 4415315 | 2018-12-17 13:04:05 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #ifndef RTC_BASE_SERVER_SOCKET_ADAPTERS_H_ |
| 12 | #define RTC_BASE_SERVER_SOCKET_ADAPTERS_H_ |
| 13 | |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 14 | #include "rtc_base/socket_adapters.h" |
Niels Möller | 4415315 | 2018-12-17 13:04:05 | [diff] [blame] | 15 | |
| 16 | namespace rtc { |
| 17 | |
| 18 | // Interface for implementing proxy server sockets. |
| 19 | class AsyncProxyServerSocket : public BufferedReadAdapter { |
| 20 | public: |
Niels Möller | d0b8879 | 2021-08-12 08:32:30 | [diff] [blame] | 21 | AsyncProxyServerSocket(Socket* socket, size_t buffer_size); |
Niels Möller | 4415315 | 2018-12-17 13:04:05 | [diff] [blame] | 22 | ~AsyncProxyServerSocket() override; |
| 23 | sigslot::signal2<AsyncProxyServerSocket*, const SocketAddress&> |
| 24 | SignalConnectRequest; |
| 25 | virtual void SendConnectResult(int err, const SocketAddress& addr) = 0; |
| 26 | }; |
| 27 | |
| 28 | // Implements a socket adapter that performs the server side of a |
| 29 | // fake SSL handshake. Used when implementing a relay server that does "ssltcp". |
| 30 | class AsyncSSLServerSocket : public BufferedReadAdapter { |
| 31 | public: |
Niels Möller | d0b8879 | 2021-08-12 08:32:30 | [diff] [blame] | 32 | explicit AsyncSSLServerSocket(Socket* socket); |
Niels Möller | 4415315 | 2018-12-17 13:04:05 | [diff] [blame] | 33 | |
Byoungchan Lee | 14af762 | 2022-01-11 20:24:58 | [diff] [blame] | 34 | AsyncSSLServerSocket(const AsyncSSLServerSocket&) = delete; |
| 35 | AsyncSSLServerSocket& operator=(const AsyncSSLServerSocket&) = delete; |
| 36 | |
Niels Möller | 4415315 | 2018-12-17 13:04:05 | [diff] [blame] | 37 | protected: |
| 38 | void ProcessInput(char* data, size_t* len) override; |
Niels Möller | 4415315 | 2018-12-17 13:04:05 | [diff] [blame] | 39 | }; |
| 40 | |
Niels Möller | 4415315 | 2018-12-17 13:04:05 | [diff] [blame] | 41 | } // namespace rtc |
| 42 | |
| 43 | #endif // RTC_BASE_SERVER_SOCKET_ADAPTERS_H_ |