use actual remote address when ip stack clients connect to proxy

This commit is contained in:
Martin Michelsen
2022-03-20 16:55:16 -07:00
parent 819027145c
commit c0193747f4
5 changed files with 73 additions and 42 deletions
+5
View File
@@ -27,6 +27,10 @@ public:
void listen(int port);
void add_socket(int fd);
inline void set_proxy_destination_address(uint32_t addr) {
this->proxy_destination_address = addr;
}
static uint32_t connect_address_for_remote_address(uint32_t remote_addr);
private:
@@ -34,6 +38,7 @@ private:
std::shared_ptr<Server> game_server;
std::shared_ptr<ProxyServer> proxy_server;
std::shared_ptr<ServerState> state;
uint32_t proxy_destination_address;
using unique_listener = std::unique_ptr<struct evconnlistener, void(*)(struct evconnlistener*)>;
using unique_bufferevent = std::unique_ptr<struct bufferevent, void(*)(struct bufferevent*)>;