websocket: native RFC 6455 transport (ws:// + wss://) — handshake, framing, ping/pong keepalive, idle timeout, origin/proxy flags, via_websocket

This commit is contained in:
Jean Chevronnet 2026-08-09 18:45:12 +00:00
parent 97b0d8ad89
commit 19157e0722
7 changed files with 633 additions and 0 deletions

View file

@ -27,6 +27,7 @@ pub enum Event {
certfp: Option<String>, // TLS client-cert fingerprint (clients only)
link: bool, // a server-to-server connection, not a client
outbound: bool, // (link) we dialed them
websocket: bool, // arrived over the WebSocket transport
},
Line {
uid: Uid,
@ -114,11 +115,17 @@ impl Ircd {
certfp,
link,
outbound,
websocket,
} => {
if link {
self.server.add_link(uid, addr, out, sock, outbound);
} else {
self.server.add_conn(uid, addr, out, sock, secure, certfp);
if websocket {
if let Some(u) = self.server.users.get_mut(&uid) {
u.flags.via_websocket = true;
}
}
}
}
Event::Line { uid, line } => {