Allow HISP Noobs to run even w a web server already running

This commit is contained in:
SilicaAndPina 2022-03-19 15:46:44 +13:00
parent 62e1a7a122
commit 994dc382c8
4 changed files with 260 additions and 247 deletions

View file

@ -277,11 +277,11 @@ namespace HTTP
e.AcceptSocket = null;
} while (!ServerSocket.AcceptAsync(e));
}
public ContentServer()
public ContentServer(string ip)
{
WriteDebugOutput("Listening for connections on port 80.");
IPEndPoint ep = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 80);
IPEndPoint ep = new IPEndPoint(IPAddress.Parse(ip), 80);
ServerSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
ServerSocket.Bind(ep);
ServerSocket.Listen(0x7fffffff);