Fixed mono bug with httplistener

This commit is contained in:
zone117x 2015-05-25 18:32:54 -06:00
parent 976f42b48c
commit 8e475e1681
1 changed files with 6 additions and 3 deletions

View File

@ -52,17 +52,20 @@ namespace Jackett
public async Task Start()
{
Program.LoggerInstance.Info("Starting HTTP server...");
Program.LoggerInstance.Info("Starting HTTP server on port " + Port + " listening " + (ListenPublic ? "publicly" : "privately"));
try
{
listener = new HttpListener();
listener.Prefixes.Add(string.Format("http://127.0.0.1:{0}/", Port));
listener.Prefixes.Add(string.Format("http://localhost:{0}/", Port));
if (ListenPublic)
{
listener.Prefixes.Add(string.Format("http://*:{0}/", Port));
}
else
{
listener.Prefixes.Add(string.Format("http://127.0.0.1:{0}/", Port));
}
listener.Start();
}