Skip to content

Commit

Permalink
Merge branch 'release/1.1.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
mostroverkhov committed Aug 20, 2022
2 parents 71ffa08 + efb99c5 commit 59c7625
Show file tree
Hide file tree
Showing 39 changed files with 746 additions and 207 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]

permissions:
contents: read

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ ubuntu-20.04, macos-11, windows-2019 ]
jdk: [ 8, 11, 17 ]
fail-fast: false

steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Build with Gradle
run: ./gradlew clean build --no-daemon


2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,5 @@ infer-out
*/.inferConfig

*/src/generated/*

bin
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
![Maven Central](https://img.shields.io/maven-central/v/com.jauntsdn.netty/netty-websocket-http2)

[![Build](https://github.com/jauntsdn/netty-websocket-http2/actions/workflows/ci-build.yml/badge.svg)](https://github.com/jauntsdn/netty-websocket-http2/actions/workflows/ci-build.yml)
# netty-websocket-http2

Netty based implementation of [rfc8441](https://tools.ietf.org/html/rfc8441) - bootstrapping websockets with http/2
Expand Down Expand Up @@ -82,7 +82,7 @@ EchoWebSocketHandler http1WebSocketHandler = new EchoWebSocketHandler();
Http2WebSocketClientHandshaker handShaker = Http2WebSocketClientHandshaker.create(channel);
Http2Headers headers =
new DefaultHttp2Headers().set("user-agent", "jauntsdn-websocket-http2-client/1.1.3");
new DefaultHttp2Headers().set("user-agent", "jauntsdn-websocket-http2-client/1.1.4");
ChannelFuture handshakeFuture =
/*http1 websocket handler*/
handShaker.handshake("/echo", headers, new EchoWebSocketHandler());
Expand Down Expand Up @@ -249,6 +249,7 @@ the results are as follows (measured over time spans of 5 seconds):

* `channelserver, channelclient` packages for websocket subchannel API demos.
* `handshakeserver, channelclient` packages for handshake only API demo.
* `multiprotocolserver, multiprotocolclient` packages for demo of server handling htt1/http2 websockets on the same port.
* `lwsclient` package for client demo that runs against [https://libwebsockets.org/testserver/](https://libwebsockets.org/testserver/) which hosts websocket-over-http2
server implemented with [libwebsockets](https://github.com/warmcat/libwebsockets) - popular C-based networking library.

Expand All @@ -269,7 +270,7 @@ repositories {
}
dependencies {
implementation 'com.jauntsdn.netty:netty-websocket-http2:1.1.3'
implementation 'com.jauntsdn.netty:netty-websocket-http2:1.1.4'
}
```

Expand Down
17 changes: 11 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ plugins {
id "com.github.ben-manes.versions"

id "com.github.sherter.google-java-format" apply false
id "com.google.osdetector" apply false
id "io.spring.dependency-management" apply false
}

Expand All @@ -27,13 +28,8 @@ description = "Netty based implementation of rfc8441 - bootstrapping websockets
apply from: "gradle/dependency-management.gradle"
apply from: "gradle/publishing.gradle"

allprojects {
dependencyLocking {
lockAllConfigurations()
}
}

subprojects {
apply plugin: "com.google.osdetector"
apply plugin: "com.github.sherter.google-java-format"

version = projectVersion(project)
Expand All @@ -44,6 +40,10 @@ subprojects {
mavenCentral()
}

dependencyLocking {
lockAllConfigurations()
}

plugins.withType(JavaPlugin) {

compileJava {
Expand All @@ -56,10 +56,15 @@ subprojects {
options.with {
links jdkJavaDoc()
links "https://netty.io/4.1/api/"
addBooleanOption("Xdoclint:all,-missing", true)
}
}

test {
if (JavaVersion.current() >= JavaVersion.VERSION_1_9) {
jvmArgs "--add-exports=java.base/sun.security.x509=ALL-UNNAMED"
}

useJUnitPlatform()
testLogging {
events "failed"
Expand Down
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
group=com.jauntsdn.netty
version=1.1.4
version=1.1.5

googleJavaFormatPluginVersion=0.9
dependencyManagementPluginVersion=1.0.11.RELEASE
dependencyManagementPluginVersion=1.0.13.RELEASE
gitPluginVersion=0.13.0
osDetectorPluginVersion=1.7.0
versionsPluginVersion=0.42.0

nettyVersion=4.1.74.Final
nettyTcnativeVersion=2.0.48.Final
nettyVersion=4.1.79.Final
nettyTcnativeVersion=2.0.54.Final
hdrHistogramVersion=2.1.12
slf4jVersion=1.7.36
logbackVersion=1.2.10
logbackVersion=1.2.11
jsr305Version=3.0.2

junitVersion=5.8.2
assertjVersion=3.22.0
junitVersion=5.9.0
assertjVersion=3.23.1

org.gradle.parallel=true
org.gradle.configureondemand=true
1 change: 1 addition & 0 deletions gradle/dependency-management.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ subprojects {
}
dependencies {
dependency "org.hdrhistogram:HdrHistogram:${hdrHistogramVersion}"
dependency "io.netty:netty-tcnative-classes:${nettyTcnativeVersion}"
dependency "io.netty:netty-tcnative-boringssl-static:${nettyTcnativeVersion}"
dependency "org.slf4j:slf4j-api:${slf4jVersion}"
dependency "ch.qos.logback:logback-classic:${logbackVersion}"
Expand Down
18 changes: 14 additions & 4 deletions gradle/publishing.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
subprojects {
def isRelease = isRelease(project)
def releasedModules = isRelease ? releaseModules() : []

tasks.withType(GenerateModuleMetadata) {
enabled = false
Expand Down Expand Up @@ -88,12 +90,20 @@ subprojects {

plugins.withType(SigningPlugin) {
signing {
sign publishing.publications.maven
required {
gradle.taskGraph.allTasks
.any { it.name.contains("publishMavenPublicationToSonatypeRepository") }
def isSigned = isRelease && releasedModules.contains(project.name)
println("Publication signed: ${isSigned}")
if (isSigned) {
sign publishing.publications.maven
}
}
}
}
}

def isRelease(Project project) {
return project.hasProperty("release") && project.property("release") == "true"
}

def releaseModules() {
return "netty-websocket-http2"
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 6 additions & 0 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
14 changes: 8 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,7 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
3 changes: 3 additions & 0 deletions multiprotocol_client.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

./gradlew netty-websocket-http2-example:runMultiProtocolClient
3 changes: 3 additions & 0 deletions multiprotocol_server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

./gradlew netty-websocket-http2-example:runMultiProtocolServer
26 changes: 19 additions & 7 deletions netty-websocket-http2-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,45 @@
*/

plugins {
id "java"
id "application"
}

description = "Netty based implementation of rfc8441 - bootstrapping websockets with http/2. Example project"

dependencies {
implementation project(":netty-websocket-http2")
implementation "io.netty:netty-tcnative-boringssl-static"
implementation "ch.qos.logback:logback-classic"
implementation "org.slf4j:slf4j-api"
runtimeOnly "io.netty:netty-tcnative-boringssl-static::${osdetector.classifier}"
runtimeOnly "ch.qos.logback:logback-classic"
}

task runHandshakeServer(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = "com.jauntsdn.netty.handler.codec.http2.websocketx.example.handshakeserver.Main"
mainClass = "com.jauntsdn.netty.handler.codec.http2.websocketx.example.handshakeserver.Main"
}

task runChannelServer(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = "com.jauntsdn.netty.handler.codec.http2.websocketx.example.channelserver.Main"
mainClass = "com.jauntsdn.netty.handler.codec.http2.websocketx.example.channelserver.Main"
}

task runMultiProtocolServer(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
mainClass = "com.jauntsdn.netty.handler.codec.http2.websocketx.example.multiprotocolserver.Main"
}

task runChannelClient(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = "com.jauntsdn.netty.handler.codec.http2.websocketx.example.channelclient.Main"
mainClass = "com.jauntsdn.netty.handler.codec.http2.websocketx.example.channelclient.Main"
}

task runLwsClient(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = "com.jauntsdn.netty.handler.codec.http2.websocketx.example.lwsclient.Main"
mainClass = "com.jauntsdn.netty.handler.codec.http2.websocketx.example.lwsclient.Main"
}

task runMultiProtocolClient(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
mainClass = "com.jauntsdn.netty.handler.codec.http2.websocketx.example.multiprotocolclient.Main"
}

25 changes: 25 additions & 0 deletions netty-websocket-http2-example/gradle.lockfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
ch.qos.logback:logback-classic:1.2.11=runtimeClasspath
ch.qos.logback:logback-core:1.2.11=runtimeClasspath
com.google.code.findbugs:jsr305:3.0.2=googleJavaFormat1.6
com.google.errorprone:error_prone_annotations:2.0.18=googleJavaFormat1.6
com.google.errorprone:javac-shaded:9+181-r4173-1=googleJavaFormat1.6
com.google.googlejavaformat:google-java-format:1.6=googleJavaFormat1.6
com.google.guava:guava:22.0=googleJavaFormat1.6
com.google.j2objc:j2objc-annotations:1.1=googleJavaFormat1.6
io.netty:netty-buffer:4.1.79.Final=compileClasspath,runtimeClasspath
io.netty:netty-codec-http2:4.1.79.Final=compileClasspath,runtimeClasspath
io.netty:netty-codec-http:4.1.79.Final=compileClasspath,runtimeClasspath
io.netty:netty-codec:4.1.79.Final=compileClasspath,runtimeClasspath
io.netty:netty-common:4.1.79.Final=compileClasspath,runtimeClasspath
io.netty:netty-handler:4.1.79.Final=compileClasspath,runtimeClasspath
io.netty:netty-resolver:4.1.79.Final=compileClasspath,runtimeClasspath
io.netty:netty-tcnative-boringssl-static:2.0.54.Final=runtimeClasspath
io.netty:netty-tcnative-classes:2.0.54.Final=runtimeClasspath
io.netty:netty-transport-native-unix-common:4.1.79.Final=compileClasspath,runtimeClasspath
io.netty:netty-transport:4.1.79.Final=compileClasspath,runtimeClasspath
org.codehaus.mojo:animal-sniffer-annotations:1.14=googleJavaFormat1.6
org.slf4j:slf4j-api:1.7.36=compileClasspath,runtimeClasspath
empty=annotationProcessor

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 59c7625

Please sign in to comment.