diff --git a/PluralKit.Bot/Services/HttpListenerService.cs b/PluralKit.Bot/Services/HttpListenerService.cs index 79573625..d2bfc4ce 100644 --- a/PluralKit.Bot/Services/HttpListenerService.cs +++ b/PluralKit.Bot/Services/HttpListenerService.cs @@ -25,15 +25,23 @@ public class HttpListenerService public void Start(string host) { - var server = new WebserverLite(new WebserverSettings(host, 5002), DefaultRoute); + var hosts = new[] { host }; + if (host == "allv4v6") + { + hosts = new[] { "[::]", "0.0.0.0" }; + } + foreach (var h in hosts) + { + var server = new WebserverLite(new WebserverSettings(h, 5002), DefaultRoute); - server.Routes.PreAuthentication.Static.Add(WatsonWebserver.Core.HttpMethod.GET, "/runtime_config", RuntimeConfigGet); - server.Routes.PreAuthentication.Parameter.Add(WatsonWebserver.Core.HttpMethod.POST, "/runtime_config/{key}", RuntimeConfigSet); - server.Routes.PreAuthentication.Parameter.Add(WatsonWebserver.Core.HttpMethod.DELETE, "/runtime_config/{key}", RuntimeConfigDelete); + server.Routes.PreAuthentication.Static.Add(WatsonWebserver.Core.HttpMethod.GET, "/runtime_config", RuntimeConfigGet); + server.Routes.PreAuthentication.Parameter.Add(WatsonWebserver.Core.HttpMethod.POST, "/runtime_config/{key}", RuntimeConfigSet); + server.Routes.PreAuthentication.Parameter.Add(WatsonWebserver.Core.HttpMethod.DELETE, "/runtime_config/{key}", RuntimeConfigDelete); - server.Routes.PreAuthentication.Parameter.Add(WatsonWebserver.Core.HttpMethod.POST, "/events/{shard_id}", GatewayEvent); + server.Routes.PreAuthentication.Parameter.Add(WatsonWebserver.Core.HttpMethod.POST, "/events/{shard_id}", GatewayEvent); - server.Start(); + server.Start(); + } } private async Task DefaultRoute(HttpContextBase ctx)