mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-09 15:50:26 +03:00
cleanup websocks
Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
parent
2f56547d5f
commit
dd8200e8b0
@ -117,7 +117,6 @@ set (CLIENT_SRC
|
||||
"${LIBI2PD_CLIENT_SRC_DIR}/SOCKS.cpp"
|
||||
"${LIBI2PD_CLIENT_SRC_DIR}/HTTPProxy.cpp"
|
||||
"${LIBI2PD_CLIENT_SRC_DIR}/I2CP.cpp"
|
||||
"${LIBI2PD_CLIENT_SRC_DIR}/WebSocks.cpp"
|
||||
)
|
||||
|
||||
add_library(libi2pdclient ${CLIENT_SRC})
|
||||
|
@ -11,7 +11,7 @@ LIB_SRC = $(wildcard $(LIB_SRC_DIR)/*.cpp)
|
||||
|
||||
#LIB_CLIENT_SRC = \
|
||||
# AddressBook.cpp BOB.cpp ClientContext.cpp I2PTunnel.cpp I2PService.cpp MatchedDestination.cpp \
|
||||
# SAM.cpp SOCKS.cpp HTTPProxy.cpp I2CP.cpp WebSocks.cpp
|
||||
# SAM.cpp SOCKS.cpp HTTPProxy.cpp I2CP.cpp
|
||||
|
||||
LIB_CLIENT_SRC = $(wildcard $(LIB_CLIENT_SRC_DIR)/*.cpp)
|
||||
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "util.h"
|
||||
#include "ClientContext.h"
|
||||
#include "SOCKS.h"
|
||||
#include "WebSocks.h"
|
||||
#include "MatchedDestination.h"
|
||||
|
||||
namespace i2p
|
||||
@ -598,10 +597,8 @@ namespace client
|
||||
}
|
||||
else if (type == I2P_TUNNELS_SECTION_TYPE_WEBSOCKS)
|
||||
{
|
||||
// websocks proxy
|
||||
auto tun = std::make_shared<WebSocks>(address, port, localDestination);
|
||||
clientTunnel = tun;
|
||||
clientEndpoint = tun->GetLocalEndpoint();
|
||||
LogPrint(eLogError, "Clients: I2P Client tunnel websocks is deprecated");
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1,72 +0,0 @@
|
||||
#include "WebSocks.h"
|
||||
#include "Log.h"
|
||||
#include <string>
|
||||
|
||||
namespace i2p
|
||||
{
|
||||
namespace client
|
||||
{
|
||||
class WebSocksImpl
|
||||
{
|
||||
public:
|
||||
WebSocksImpl(const std::string & addr, int port) : m_Addr(addr), m_Port(port)
|
||||
{
|
||||
}
|
||||
|
||||
~WebSocksImpl()
|
||||
{
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
LogPrint(eLogInfo, "[Tunnels] starting websocks tunnel at %s:%d is rejected: WebSockets is deprecated", m_Addr, m_Port);
|
||||
}
|
||||
|
||||
void Stop()
|
||||
{
|
||||
}
|
||||
|
||||
void InitializeDestination(WebSocks * parent)
|
||||
{
|
||||
}
|
||||
|
||||
boost::asio::ip::tcp::endpoint GetLocalEndpoint()
|
||||
{
|
||||
return boost::asio::ip::tcp::endpoint(boost::asio::ip::address::from_string(m_Addr), m_Port);
|
||||
}
|
||||
|
||||
std::string m_Addr;
|
||||
int m_Port;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace i2p
|
||||
{
|
||||
namespace client
|
||||
{
|
||||
WebSocks::WebSocks(const std::string & addr, int port, std::shared_ptr<ClientDestination> localDestination) : m_Impl(new WebSocksImpl(addr, port))
|
||||
{
|
||||
m_Impl->InitializeDestination(this);
|
||||
}
|
||||
WebSocks::~WebSocks() { delete m_Impl; }
|
||||
|
||||
void WebSocks::Start()
|
||||
{
|
||||
m_Impl->Start();
|
||||
GetLocalDestination()->Start();
|
||||
}
|
||||
|
||||
boost::asio::ip::tcp::endpoint WebSocks::GetLocalEndpoint() const
|
||||
{
|
||||
return m_Impl->GetLocalEndpoint();
|
||||
}
|
||||
|
||||
void WebSocks::Stop()
|
||||
{
|
||||
m_Impl->Stop();
|
||||
GetLocalDestination()->Stop();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
#ifndef WEBSOCKS_H_
|
||||
#define WEBSOCKS_H_
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include "I2PService.h"
|
||||
#include "Destination.h"
|
||||
|
||||
namespace i2p
|
||||
{
|
||||
namespace client
|
||||
{
|
||||
|
||||
class WebSocksImpl;
|
||||
|
||||
/** @brief websocket socks proxy server */
|
||||
class WebSocks : public i2p::client::I2PService
|
||||
{
|
||||
public:
|
||||
WebSocks(const std::string & addr, int port, std::shared_ptr<ClientDestination> localDestination);
|
||||
~WebSocks();
|
||||
|
||||
void Start();
|
||||
void Stop();
|
||||
|
||||
boost::asio::ip::tcp::endpoint GetLocalEndpoint() const;
|
||||
|
||||
const char * GetName() { return "WebSOCKS Proxy"; }
|
||||
|
||||
private:
|
||||
WebSocksImpl * m_Impl;
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif
|
@ -73,7 +73,6 @@ SOURCES += DaemonQT.cpp mainwindow.cpp \
|
||||
../../libi2pd_client/MatchedDestination.cpp \
|
||||
../../libi2pd_client/SAM.cpp \
|
||||
../../libi2pd_client/SOCKS.cpp \
|
||||
../../libi2pd_client/WebSocks.cpp \
|
||||
../../daemon/Daemon.cpp \
|
||||
../../daemon/HTTPServer.cpp \
|
||||
../../daemon/I2PControl.cpp \
|
||||
@ -162,7 +161,6 @@ HEADERS += DaemonQT.h mainwindow.h \
|
||||
../../libi2pd_client/MatchedDestination.h \
|
||||
../../libi2pd_client/SAM.h \
|
||||
../../libi2pd_client/SOCKS.h \
|
||||
../../libi2pd_client/WebSocks.h \
|
||||
../../daemon/Daemon.h \
|
||||
../../daemon/HTTPServer.h \
|
||||
../../daemon/I2PControl.h \
|
||||
|
Loading…
Reference in New Issue
Block a user