mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 11:17:49 +02:00
add initial WebSOCKS implementation
This commit is contained in:
parent
d0e9fe1e3e
commit
0d83a34cfd
6 changed files with 458 additions and 2 deletions
10
Daemon.cpp
10
Daemon.cpp
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include "Event.h"
|
||||
#include "Websocket.h"
|
||||
#include "WebSocks.h"
|
||||
|
||||
namespace i2p
|
||||
{
|
||||
|
@ -43,6 +44,7 @@ namespace i2p
|
|||
std::unique_ptr<i2p::transport::UPnP> UPnP;
|
||||
#ifdef WITH_EVENTS
|
||||
std::unique_ptr<i2p::event::WebsocketServer> m_WebsocketServer;
|
||||
std::unique_ptr<i2p::client::WebSocks> m_WebSocksServer;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -307,6 +309,14 @@ namespace i2p
|
|||
d.m_WebsocketServer->Start();
|
||||
i2p::event::core.SetListener(d.m_WebsocketServer->ToListener());
|
||||
}
|
||||
bool websocks; i2p::config::GetOption("websocks.enabled", websocks);
|
||||
if (websocks) {
|
||||
std::string websocksAddr; i2p::config::GetOption("websocks.address", websocksAddr);
|
||||
uint16_t websocksPort; i2p::config::GetOption("websocks.port", websocksPort);
|
||||
LogPrint(eLogInfo, "Daemon: starting up WebSOCKS server at ", websocksAddr, ":", websocksPort);
|
||||
d.m_WebSocksServer = std::unique_ptr<i2p::client::WebSocks>(new i2p::client::WebSocks(websocksAddr, websocksPort));
|
||||
d.m_WebSocksServer->Start();
|
||||
}
|
||||
|
||||
#endif
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue