libnetty项目
一组基于NetTy4.2.x的有用库。
自3.0版以来,所有模块都是基于JDK-17编译的。
添加依赖项
添加Maven依赖性
pom.xml
libnetty-bom</artifactId>
<version>3.8.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- HTTP server -->
<dependency>
<groupId>com.github.fmjsjx</groupId>
<artifactId> libnetty -http-server</artifactId>
</dependency>
</dependencies>
</pom>">
< pom > < dependencyManagement > < dependencies > <!-- BOM --> < dependency > < groupId >com.github.fmjsjx</ groupId > < artifactId > libnetty -bom</ artifactId > < version >3.8.1</ version > < type >pom</ type > < scope >import</ scope > </ dependency > </ dependencies > </ dependencyManagement > < dependencies > <!-- HTTP server --> < dependency > < groupId >com.github.fmjsjx</ groupId > < artifactId > libnetty -http-server</ artifactId > </ dependency > </ dependencies > </ pom >
添加gradle依赖性
Groovy DSL
libnetty-bom:3.8.1')
// HTTP server
implementation 'com.github.fmjsjx: libnetty -http-server'
}">
repositories {
mavenCentral
}
dependencies {
// BOM
implementation platform( ' com.github.fmjsjx: libnetty -bom:3.8.1 ' )
// HTTP server
implementation ' com.github.fmjsjx: libnetty -http-server '
}
Kotlin DSL
libnetty-bom:3.8.1"))
// HTTP server
implementation("com.github.fmjsjx: libnetty -http-server")
}">
repositories {
mavenCentral()
}
dependencies {
// BOM
implementation(platform( " com.github.fmjsjx: libnetty -bom:3.8.1 " ))
// HTTP server
implementation( " com.github.fmjsjx: libnetty -http-server " )
}
模块
libnetty中有许多模块,这是一个快速概述:
libnetty -fastcgi
libnetty -fastcgi模块为Fast-CGI提供编解码器组件。
libnetty -handler
libnetty -handler模块为netty-handler提供了其他功能。
libnetty -http
libnetty -http模块为HTTP/1.x提供了其他实用程序功能。
libnetty -http -client
libnetty -http-client模块提供了一个简化的HTTP客户端,支持同步和异步(基于JDK8+ CompletableFuture)API。
libnetty -http -server
libnetty -http-server模块提供了简化的HTTP服务器框架。
libnetty -Resp
libnetty -resp模块提供了用于RESP(REdis Serialization Protocol)的编解码器组件。
libnetty -resp3
libnetty -resp3模块提供了用于RESP3 specification编解码器组件。
libnetty -transport
libnetty -transport模块为netty-transport提供了其他功能,例如auto-selection of java/native transport 。
下载源码
通过命令行克隆项目:
git clone https://github.com/fmjsjx/libnetty.git