mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-13 04:46:38 +01:00
Do not bind HTTPServer to the "any" address (#235).
This commit is contained in:
parent
7d38b1a9b9
commit
a7da2423ce
4 changed files with 8 additions and 4 deletions
|
@ -106,7 +106,10 @@ namespace i2p
|
||||||
StartLog (""); // write to stdout
|
StartLog (""); // write to stdout
|
||||||
}
|
}
|
||||||
|
|
||||||
d.httpServer = new i2p::util::HTTPServer(i2p::util::config::GetArg("-httpport", 7070));
|
d.httpServer = new i2p::util::HTTPServer(
|
||||||
|
i2p::util::config::GetArg("-httpaddress", "127.0.0.1"),
|
||||||
|
i2p::util::config::GetArg("-httpport", 7070)
|
||||||
|
);
|
||||||
d.httpServer->Start();
|
d.httpServer->Start();
|
||||||
LogPrint("HTTP Server started");
|
LogPrint("HTTP Server started");
|
||||||
i2p::data::netdb.Start();
|
i2p::data::netdb.Start();
|
||||||
|
|
|
@ -1042,9 +1042,9 @@ namespace util
|
||||||
std::bind (&HTTPConnection::HandleWriteReply, shared_from_this (), std::placeholders::_1));
|
std::bind (&HTTPConnection::HandleWriteReply, shared_from_this (), std::placeholders::_1));
|
||||||
}
|
}
|
||||||
|
|
||||||
HTTPServer::HTTPServer (int port):
|
HTTPServer::HTTPServer (const std::string& address, int port):
|
||||||
m_Thread (nullptr), m_Work (m_Service),
|
m_Thread (nullptr), m_Work (m_Service),
|
||||||
m_Acceptor (m_Service, boost::asio::ip::tcp::endpoint (boost::asio::ip::tcp::v4 (), port)),
|
m_Acceptor (m_Service, boost::asio::ip::tcp::endpoint (boost::asio::ip::address::from_string(address), port)),
|
||||||
m_NewSocket (nullptr)
|
m_NewSocket (nullptr)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ namespace util
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
HTTPServer (int port);
|
HTTPServer (const std::string& address, int port);
|
||||||
virtual ~HTTPServer ();
|
virtual ~HTTPServer ();
|
||||||
|
|
||||||
void Start ();
|
void Start ();
|
||||||
|
|
|
@ -73,6 +73,7 @@ Cmdline options
|
||||||
* --host= - The external IP (deprecated).
|
* --host= - The external IP (deprecated).
|
||||||
* --port= - The port to listen on
|
* --port= - The port to listen on
|
||||||
* --httpport= - The http port to listen on
|
* --httpport= - The http port to listen on
|
||||||
|
* --httpaddress= - The ip address for the HTTP server, 127.0.0.1 by default
|
||||||
* --log= - Enable or disable logging to file. 1 for yes, 0 for no.
|
* --log= - Enable or disable logging to file. 1 for yes, 0 for no.
|
||||||
* --daemon= - Enable or disable daemon mode. 1 for yes, 0 for no.
|
* --daemon= - Enable or disable daemon mode. 1 for yes, 0 for no.
|
||||||
* --service= - 1 if uses system folders (/var/run/i2pd.pid, /var/log/i2pd.log, /var/lib/i2pd).
|
* --service= - 1 if uses system folders (/var/run/i2pd.pid, /var/log/i2pd.log, /var/lib/i2pd).
|
||||||
|
|
Loading…
Add table
Reference in a new issue