Skip to content

Commit ca28994

Browse files
authored
feat(ws): add compio-ws, async WebSocket support for compio runtime (#501)
* feat: add compio-ws with async WebSocket support for compio runtime * chore: fix clippy and fmt issues * fix: remove readme * fix: remove `compio` as dependency * fix: add tests * fix: echo_server * fix: move driver and runtime to dev-dependencies * fix: address review comments
1 parent 0bc590d commit ca28994

20 files changed

Lines changed: 5508 additions & 1 deletion

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ members = [
1414
"compio-runtime",
1515
"compio-signal",
1616
"compio-tls",
17+
"compio-ws",
1718
]
1819
resolver = "2"
1920

@@ -38,6 +39,7 @@ compio-log = { path = "./compio-log", version = "0.1.0" }
3839
compio-tls = { path = "./compio-tls", version = "0.7.1", default-features = false }
3940
compio-process = { path = "./compio-process", version = "0.6.0" }
4041
compio-quic = { path = "./compio-quic", version = "0.5.0", default-features = false }
42+
compio-ws = { path = "./compio-ws", version = "0.1.0", default-features = false }
4143

4244
bytes = "1.7.1"
4345
cfg_aliases = "0.2.1"

compio-ws/Cargo.toml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
[package]
2+
name = "compio-ws"
3+
version = "0.1.0"
4+
description = "WebSocket library for the compio runtime"
5+
edition = { workspace = true }
6+
authors = { workspace = true }
7+
readme = { workspace = true }
8+
license = { workspace = true }
9+
repository = { workspace = true }
10+
11+
12+
[dependencies]
13+
rustls = { workspace = true, optional = true, default-features = false }
14+
rustls-platform-verifier = { version = "0.6.0", optional = true }
15+
tungstenite = "0.28.0"
16+
compio-io = { workspace = true }
17+
compio-net = { workspace = true, optional = true }
18+
compio-tls = { workspace = true, optional = true, default-features = false, features = [
19+
"rustls",
20+
] }
21+
compio-buf = { workspace = true }
22+
webpki-roots = { version = "1.0.4", optional = true }
23+
rustls-pemfile = "2.0"
24+
log = "0.4"
25+
26+
[features]
27+
default = []
28+
connect = ["dep:compio-net"]
29+
rustls = ["connect", "dep:compio-tls", "dep:rustls", "compio-tls/rustls"]
30+
rustls-platform-verifier = ["rustls", "dep:rustls-platform-verifier"]
31+
webpki-roots = ["rustls", "dep:webpki-roots"]
32+
ring = ["rustls?/ring", "compio-tls?/ring"]
33+
34+
35+
[dev-dependencies]
36+
log = "0.4"
37+
env_logger = "0.11"
38+
compio-net = { workspace = true }
39+
compio-macros = { workspace = true }
40+
futures-channel = { workspace = true }
41+
compio-runtime = { workspace = true }
42+
compio-driver = { workspace = true }
43+
44+
[[example]]
45+
name = "echo_server"
46+
required-features = ["connect"]
47+
48+
[[example]]
49+
name = "client"
50+
required-features = ["connect"]
51+
52+
[[example]]
53+
name = "autobahn-client"
54+
required-features = ["connect"]
55+
56+
[[example]]
57+
name = "autobahn-server"
58+
required-features = ["connect"]
59+
60+
[[example]]
61+
name = "echo_server_tls"
62+
required-features = ["connect", "rustls", "ring"]
63+
[[example]]
64+
name = "client_tls"
65+
required-features = ["connect", "rustls", "ring"]
66+
67+
[[test]]
68+
name = "websocket"
69+
required-features = ["connect", "compio-driver/io-uring"]

0 commit comments

Comments
 (0)