Skip to content

Commit

Permalink
Merge pull request #248 from c410-f3r/misc
Browse files Browse the repository at this point in the history
WebSocket over HTTP/2
  • Loading branch information
c410-f3r authored Oct 24, 2024
2 parents 3604cd5 + 9752e87 commit d1797f6
Show file tree
Hide file tree
Showing 189 changed files with 6,283 additions and 4,203 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
use-tool-cache: true
- run: .scripts/fuzz.sh

h2spec:
h2spec-high:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -54,7 +54,19 @@ jobs:
profile: minimal
toolchain: nightly-2024-09-01
- uses: Swatinem/rust-cache@v2
- run: .scripts/h2spec.sh ci
- run: .scripts/h2spec.sh high ci

h2spec-low:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
override: true
profile: minimal
toolchain: nightly-2024-09-01
- uses: Swatinem/rust-cache@v2
- run: .scripts/h2spec.sh low ci

integration-tests:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions .scripts/autobahn-fuzzingclient.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ if [ "$ARG" != "ci" ]; then
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT
fi;

cargo build --bin autobahn-server --features flate2,optimization,pool,tokio,web-socket-handshake --release
cargo run --bin autobahn-server --features flate2,optimization,pool,tokio,web-socket-handshake --release & cargo_pid=$!
cargo build --bin autobahn-server --features flate2,nightly,optimization,pool,tokio,web-socket-handshake --release
cargo run --bin autobahn-server --features flate2,nightly,optimization,pool,tokio,web-socket-handshake --release & cargo_pid=$!
sleep 1
mkdir -p .scripts/autobahn/reports/fuzzingclient
podman run \
Expand Down
6 changes: 4 additions & 2 deletions .scripts/curl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ else
autoreconf -fi
./configure --enable-debug --with-nghttp2 --without-ssl
make
cd tests
cd tests/server
make
cd ..
fi

cargo build --bin wtx-ui --features http-client --release
cargo build --bin wtx-ui --features _curl,http-client --release
./runtests.pl -d -n -c "$PWD/../../target/release/wtx-ui"
14 changes: 14 additions & 0 deletions .scripts/h2load.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

set -euxo pipefail

ARG=${1:-""}
if [ "$ARG" != "ci" ]; then
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT
fi;

cargo build --bin h2load --features="wtx/http2,wtx/nightly" --profile deploy
cargo run --bin h2load --features="wtx/http2,wtx/nightly" --profile deploy &
sleep 1

h2load -c100 -m10 -n100000 --no-tls-proto=h2c http://localhost:9000
21 changes: 14 additions & 7 deletions .scripts/h2spec.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
#!/usr/bin/env bash

set -euxo pipefail

ARG=${1:-""}
if [ "$ARG" != "ci" ]; then
TY=${1:-"high"}
CI=${2:-""}

if [ "$CI" != "ci" ]; then
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT
fi;

cargo build --bin h2spec-server --features="http2,tokio" --release
cargo run --bin h2spec-server --features="http2,tokio" --release &> /tmp/h2spec-server.txt & cargo_pid=$!
sleep 1
touch /tmp/h2spec-server.xml

if [ "$TY" != "high" ]; then
TY="low";
fi;

cargo build --bin "h2spec-$TY-server" --features="http2,nightly,tokio" --release
cargo run --bin "h2spec-$TY-server" --features="http2,nightly,tokio" --release &> /tmp/h2spec-server.txt &
sleep 1

podman run \
-v "/tmp/h2spec-server.xml:/tmp/h2spec-server.xml" \
--name h2spec \
Expand Down Expand Up @@ -59,5 +68,3 @@ podman run \
http2/7 \
http2/8.1 \
`#http2/8.2 - Server push is unsupported`

kill -9 $cargo_pid
Loading

0 comments on commit d1797f6

Please sign in to comment.