Skip to content

Commit

Permalink
Merge branch 'main' into default-content-type
Browse files Browse the repository at this point in the history
  • Loading branch information
biryukovmaxim committed Jun 19, 2023
2 parents 993eaaf + aa21170 commit 6fe6acb
Show file tree
Hide file tree
Showing 19 changed files with 509 additions and 107 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/socketio-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:
- name: Install deps & run tests
run: |
cd socket.io-protocol/test-suite && npm install && cd ../..
cargo build --example socketio-axum-echo --release
cargo run --example socketio-axum-echo --release > server.txt & npm --prefix socket.io-protocol/test-suite test > client.txt
cargo build --bin socketioxide-e2e --release
cargo run --bin socketioxide-e2e --release > server.txt & npm --prefix socket.io-protocol/test-suite test > client.txt
- name: Server output
if: always()
run: cat server.txt
Expand Down
193 changes: 190 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[workspace]
members = ["engineioxide", "socketioxide", "examples"]
members = ["engineioxide", "socketioxide", "examples", "e2e"]
8 changes: 4 additions & 4 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
[![SocketIO CI](https://github.com/Totodore/socketioxide/actions/workflows/socketio-ci.yml/badge.svg)](https://github.com/Totodore/socketioxide/actions/workflows/socketio-ci.yml)
### Socket.IO server implementation as a [tower layer](https://docs.rs/tower/latest/tower/) in Rust
It integrates with any framework based on tower/hyper, such as:
* [axum](https://docs.rs/axum/latest/axum/)
* [warp](https://docs.rs/warp/latest/warp/)
* [hyper](https://docs.rs/hyper/latest/hyper/)
* [axum](https://docs.rs/axum/latest/axum/): [echo implementation](./examples/src/socketio-echo/axum_echo.rs)
* [warp](https://docs.rs/warp/latest/warp/): [echo implementation](./examples/src/socketio-echo/warp_echo.rs)
* [hyper](https://docs.rs/hyper/latest/hyper/): [echo implementation](./examples/src/socketio-echo/hyper_echo.rs)

It takes full advantage of the [tower](https://docs.rs/tower/latest/tower/) and [tower-http](https://docs.rs/tower-http/latest/tower_http/) ecosystem of middleware, services, and utilities.

Expand Down Expand Up @@ -73,7 +73,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.route("/", get(|| async { "Hello, World!" }))
.layer(SocketIoLayer::new(ns));

Server::bind(&"0.0.0.0:3000".parse().unwrap())
Server::bind(&"127.0.0.1:3000".parse().unwrap())
.serve(app.into_make_service())
.await?;

Expand Down
23 changes: 23 additions & 0 deletions e2e/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "socketioxide-e2e"
version = "0.3.0"
edition = "2021"

[dependencies]
engineioxide = { path = "../engineioxide" }
socketioxide = { path = "../socketioxide" }
hyper = { version = "0.14.26" }
tokio = { version = "1.13.0", features = ["full"] }
tower = { version = "0.4.13" }
tracing-subscriber = { version = "0.3.16", features = ["env-filter"] }
tracing = "0.1.37"
serde_json = "1.0.95"
futures = "0.3.27"

[[bin]]
name = "socketioxide-e2e"
path = "src/socketioxide.rs"

[[bin]]
name = "engineioxide-e2e"
path = "src/engineioxide.rs"
Loading

0 comments on commit 6fe6acb

Please sign in to comment.