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;
* @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
*
* @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();