diff --git a/proxy/build.gradle b/proxy/build.gradle index 9c5bf26fb..216e58cc8 100644 --- a/proxy/build.gradle +++ b/proxy/build.gradle @@ -48,6 +48,8 @@ dependencies { compile "io.netty:netty-handler:${nettyVersion}" compile "io.netty:netty-transport-native-epoll:${nettyVersion}" compile "io.netty:netty-transport-native-epoll:${nettyVersion}:linux-x86_64" + compile "io.netty:netty-transport-native-kqueue:${nettyVersion}" + compile "io.netty:netty-transport-native-kqueue:${nettyVersion}:osx-x86_64" compile "io.netty:netty-resolver-dns:${nettyVersion}" compile "org.apache.logging.log4j:log4j-api:${log4jVersion}" @@ -65,7 +67,7 @@ dependencies { compile 'com.mojang:brigadier:1.0.15' - compile 'org.asynchttpclient:async-http-client:2.10.1' + compile 'org.asynchttpclient:async-http-client:2.10.4' compile 'com.spotify:completable-futures:0.3.2' diff --git a/proxy/src/main/java/com/velocitypowered/proxy/network/TransportType.java b/proxy/src/main/java/com/velocitypowered/proxy/network/TransportType.java index b5829f375..0edff72c0 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/network/TransportType.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/network/TransportType.java @@ -7,6 +7,11 @@ import io.netty.channel.epoll.EpollDatagramChannel; import io.netty.channel.epoll.EpollEventLoopGroup; import io.netty.channel.epoll.EpollServerSocketChannel; import io.netty.channel.epoll.EpollSocketChannel; +import io.netty.channel.kqueue.KQueue; +import io.netty.channel.kqueue.KQueueDatagramChannel; +import io.netty.channel.kqueue.KQueueEventLoopGroup; +import io.netty.channel.kqueue.KQueueServerSocketChannel; +import io.netty.channel.kqueue.KQueueSocketChannel; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.DatagramChannel; import io.netty.channel.socket.ServerSocketChannel; @@ -22,7 +27,11 @@ enum TransportType { (name, type) -> new NioEventLoopGroup(0, createThreadFactory(name, type))), EPOLL("epoll", EpollServerSocketChannel.class, EpollSocketChannel.class, EpollDatagramChannel.class, - (name, type) -> new EpollEventLoopGroup(0, createThreadFactory(name, type))); + (name, type) -> new EpollEventLoopGroup(0, createThreadFactory(name, type))), + KQUEUE("Kqueue", KQueueServerSocketChannel.class, KQueueSocketChannel.class, + KQueueDatagramChannel.class, + (name, type) -> new KQueueEventLoopGroup(0, createThreadFactory(name, type))); + final String name; final Class serverSocketChannelClass; @@ -62,6 +71,8 @@ enum TransportType { if (Epoll.isAvailable()) { return EPOLL; + } else if (KQueue.isAvailable()) { + return KQUEUE; } else { return NIO; }