Skip to content

Commit

Permalink
Allow the EmbedIO server to listen on all IP addresses.
Browse files Browse the repository at this point in the history
  • Loading branch information
YoRyan committed Jul 25, 2020
1 parent 253eec2 commit 13fcbd7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/RunActivity/Viewer3D/Processes/WebServerProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
// This file is the responsibility of the 3D & Environment Team.


using EmbedIO.Net;
using System.Threading;
using Orts.Viewer3D.WebServices;
using ORTS.Common;
Expand Down Expand Up @@ -63,9 +64,8 @@ void WebServerThread()
return;

string myWebContentPath = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "Content\\Web");
string Url(string ip) => $"http://{ip}:{Game.Settings.WebServerPort}";
var urls = new string[] { Url("[::1]"), Url("127.0.0.1"), Url("localhost") };
using (EmbedIO.WebServer server = WebServer.CreateWebServer(urls, myWebContentPath))
EndPointManager.UseIpv6 = true;
using (EmbedIO.WebServer server = WebServer.CreateWebServer($"http://*:{Game.Settings.WebServerPort}", myWebContentPath))
server.RunAsync(StopServer.Token).Wait();
}
}
Expand Down

0 comments on commit 13fcbd7

Please sign in to comment.