Skip to content

Commit

Permalink
Updated libraries and removed support for NanoHTTPD. (1.18.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
e3ndr committed Jun 26, 2022
1 parent 65e3538 commit d59752c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 33 deletions.
30 changes: 6 additions & 24 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>co.casterlabs</groupId>
<artifactId>Katana</artifactId>
<version>1.17.1</version>
<version>1.18.0</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -90,19 +90,13 @@
<dependency>
<groupId>com.github.casterlabs.rakurai</groupId>
<artifactId>Http-Server</artifactId>
<version>1.14.1</version>
<version>1.14.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.undertow</groupId>
<artifactId>undertow-core</artifactId>
<version>2.2.0.Final</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.nanohttpd</groupId>
<artifactId>nanohttpd-websocket</artifactId>
<version>2.3.1</version>
<version>2.2.18.Final</version>
<scope>compile</scope>
</dependency>

Expand All @@ -117,7 +111,7 @@
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.9.3</version>
<version>4.10.0</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand All @@ -126,12 +120,6 @@
<version>1.5.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>1.7.30</version>
<scope>compile</scope>
</dependency>

<!-- Utilities -->
<dependency>
Expand All @@ -155,19 +143,13 @@
<dependency>
<groupId>com.github.e3ndr</groupId>
<artifactId>FastLoggingFramework</artifactId>
<version>1.8.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.fusesource.jansi</groupId>
<artifactId>jansi</artifactId>
<version>1.18</version>
<version>1.8.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.e3ndr</groupId>
<artifactId>ReflectionLib</artifactId>
<version>1.0.0</version>
<version>1.1.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
8 changes: 0 additions & 8 deletions src/main/java/co/casterlabs/katana/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import co.casterlabs.katana.http.servlets.RedirectServlet;
import co.casterlabs.katana.http.servlets.StaticServlet;
import co.casterlabs.katana.http.servlets.WebSocketProxyServlet;
import co.casterlabs.rakurai.io.http.server.HttpServerImplementation;
import co.casterlabs.rakurai.json.Rson;
import co.casterlabs.rakurai.json.element.JsonArray;
import lombok.Getter;
Expand Down Expand Up @@ -39,13 +38,6 @@ public class Launcher implements Runnable {
}, description = "Enables debug logging")
private boolean debug = false;

@Getter
@Option(names = {
"-s",
"--server-implementation"
}, description = "Sets the desired server implementation")
private HttpServerImplementation implementation = HttpServerImplementation.UNDERTOW;

public static void main(String[] args) {
ClassLoader.getSystemClassLoader().setDefaultAssertionStatus(true); // Enable assertions
new CommandLine(new Launcher()).execute(args);
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/co/casterlabs/katana/http/HttpRouter.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import co.casterlabs.rakurai.io.http.server.HttpListener;
import co.casterlabs.rakurai.io.http.server.HttpServer;
import co.casterlabs.rakurai.io.http.server.HttpServerBuilder;
import co.casterlabs.rakurai.io.http.server.HttpServerImplementation;
import co.casterlabs.rakurai.io.http.server.SSLConfiguration;
import co.casterlabs.rakurai.io.http.websocket.WebsocketListener;
import co.casterlabs.rakurai.io.http.websocket.WebsocketSession;
Expand All @@ -36,6 +37,7 @@

@Getter
public class HttpRouter implements HttpListener {
private static final HttpServerImplementation SERVER_IMPLEMENTATION = HttpServerImplementation.UNDERTOW;
private static final String ALLOWED_METHODS;

private MultiValuedMap<String, HttpServlet> hostnames = new ArrayListValuedHashMap<>();
Expand Down Expand Up @@ -76,7 +78,7 @@ public HttpRouter(ServerConfiguration config, Katana katana) throws IOException
this.katana = katana;
this.config = config;

HttpServerBuilder builder = HttpServerBuilder.get(this.katana.getLauncher().getImplementation());
HttpServerBuilder builder = HttpServerBuilder.get(SERVER_IMPLEMENTATION);

builder.setPort(this.config.getPort());
builder.setHttp2Enabled(true);
Expand Down

0 comments on commit d59752c

Please sign in to comment.