X-Git-Url: http://git.nikiroo.be/?p=nikiroo-utils.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2FMain.java;h=c02abb387c0309ad79a8cba66d79733af22a775a;hp=e48f4f53ec7ab7d1951ea4760cacdb64afbccc51;hb=fcec1f3121e8c0acfe189124ebcf90415c1240e9;hpb=bf9c483d826523d68ab6b2dfc9e77b515813c09c diff --git a/src/be/nikiroo/fanfix/Main.java b/src/be/nikiroo/fanfix/Main.java index e48f4f5..c02abb3 100644 --- a/src/be/nikiroo/fanfix/Main.java +++ b/src/be/nikiroo/fanfix/Main.java @@ -648,6 +648,18 @@ public class Main { if (port == null) port = Instance.getInstance().getConfig().getInteger(Config.SERVER_PORT); + if (host == null) { + String mode = Instance.getInstance().getConfig() + .getString(Config.SERVER_MODE, "fanfix"); + if ("http".equals(mode)) { + host = "http://localhost"; + } else if ("https".equals(mode)) { + host = "https://localhost"; + } else if ("fanfix".equals(mode)) { + host = "fanfix://localhost"; + } + } + if (port == null) { System.err.println("No port given nor configured in the config file"); exitCode = 15; @@ -1069,7 +1081,7 @@ public class Main { * @param key * the key to contact the Fanfix server * @param host - * the host on which it runs (NULL means localhost) + * the host on which it runs * @param port * the port on which it runs * @@ -1078,7 +1090,7 @@ public class Main { * @throws SSLException * when the key was not accepted */ - private void stopServer(String key, String host, Integer port) + private void stopServer(String key, String host, int port) throws IOException, SSLException { if (host.startsWith("http://") || host.startsWith("https://")) { new WebLibrary(key, host, port).stop();