add ALPN and headers needed for meet.jit.si

This commit is contained in:
xenia 2022-05-08 00:06:56 -04:00
parent 72c3062010
commit 173ace76a6
3 changed files with 9 additions and 1 deletions

2
Cargo.lock generated
View File

@ -519,7 +519,7 @@ dependencies = [
[[package]] [[package]]
name = "gst-meet" name = "gst-meet"
version = "0.4.0" version = "0.4.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"cocoa", "cocoa",

View File

@ -24,6 +24,7 @@ pub(crate) fn wss_connector(insecure: bool) -> Result<tokio_tungstenite::Connect
.with_safe_defaults() .with_safe_defaults()
.with_root_certificates(roots) .with_root_certificates(roots)
.with_no_client_auth(); .with_no_client_auth();
config.alpn_protocols.push(b"http/1.1".to_vec());
#[cfg(feature = "tls-insecure")] #[cfg(feature = "tls-insecure")]
if insecure { if insecure {
config config

View File

@ -87,6 +87,13 @@ impl Connection {
.header("sec-websocket-protocol", "xmpp") .header("sec-websocket-protocol", "xmpp")
.header("sec-websocket-key", base64::encode(&key)) .header("sec-websocket-key", base64::encode(&key))
.header("sec-websocket-version", "13") .header("sec-websocket-version", "13")
.header("user-agent", "Mozilla/5.0 (X11; Linux aarch64; rv:99.0) Gecko/20100101 Firefox/99.0")
.header("origin",
format!("https://{}",
websocket_url
.host()
.context("invalid WebSocket URL: missing host")?,
))
.header( .header(
"host", "host",
websocket_url websocket_url