Merge branch 'master' of https://github.com/Johni0702/mumble-web-proxy
This commit is contained in:
commit
0cbc9869f1
839
Cargo.lock
generated
839
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
18
Cargo.toml
18
Cargo.toml
|
@ -6,20 +6,20 @@ edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
argparse = "0.2.2"
|
argparse = "0.2.2"
|
||||||
bytes = "0.5"
|
bytes = "1"
|
||||||
byteorder = "1.2"
|
byteorder = "1.2"
|
||||||
futures = { version = "0.3", features = ["compat", "io-compat"] }
|
futures = { version = "0.3", features = ["compat", "io-compat"] }
|
||||||
toml = "0.5"
|
toml = "0.5"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
tokio = { version = "0.2", features = ["full"] }
|
tokio = { version = "1", features = ["full"] }
|
||||||
tokio-util = { version = "0.3", features = ["codec"] }
|
tokio-util = { version = "0.6", features = ["codec"] }
|
||||||
tokio-tls = "0.3"
|
tokio-native-tls = "0.3"
|
||||||
native-tls = "0.2"
|
native-tls = "0.2"
|
||||||
mumble-protocol = { version = "0.3", features = ["webrtc-extensions"] }
|
mumble-protocol = { version = "0.4", features = ["webrtc-extensions"] }
|
||||||
tokio-tungstenite = "0.10"
|
tokio-tungstenite = "0.13"
|
||||||
http = "0.2"
|
http = "0.2"
|
||||||
tungstenite = "0.10"
|
tungstenite = "0.12"
|
||||||
rtp = { git = "https://github.com/johni0702/rtp", rev = "1444b3c", features = ["rfc5764-openssl"] }
|
rtp = { git = "https://github.com/johni0702/rtp", rev = "6c0223d", features = ["rfc5764-openssl"] }
|
||||||
libnice = "0.2.1"
|
libnice = "0.3"
|
||||||
webrtc-sdp = "0.3"
|
webrtc-sdp = "0.3"
|
||||||
openssl = "0.10"
|
openssl = "0.10"
|
||||||
|
|
|
@ -13,7 +13,7 @@ Note that it requires an extension to the Mumble protocol which has not yet been
|
||||||
|
|
||||||
#### Prerequisites
|
#### Prerequisites
|
||||||
|
|
||||||
- Rust 1.39+ (e.g. via [rustup](https://rustup.rs/))
|
- Rust 1.45+ (e.g. via [rustup](https://rustup.rs/))
|
||||||
- libnice development headers (`libnice-devel` on Fedora, `libnice-dev` on Debian)
|
- libnice development headers (`libnice-devel` on Fedora, `libnice-dev` on Debian)
|
||||||
- OpenSSL development headers (`openssl-devel` on Fedora, `libssl-dev` on Debian)
|
- OpenSSL development headers (`openssl-devel` on Fedora, `libssl-dev` on Debian)
|
||||||
- clang (`clang` on Fedora and Debian)
|
- clang (`clang` on Fedora and Debian)
|
||||||
|
|
|
@ -30,7 +30,7 @@ use std::task::Context;
|
||||||
use std::task::Poll;
|
use std::task::Poll;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use tokio::io;
|
use tokio::io;
|
||||||
use tokio::time::Delay;
|
use tokio::time::Sleep;
|
||||||
use webrtc_sdp::attribute_type::SdpAttribute;
|
use webrtc_sdp::attribute_type::SdpAttribute;
|
||||||
|
|
||||||
use crate::error::Error;
|
use crate::error::Error;
|
||||||
|
@ -39,10 +39,10 @@ use crate::Config;
|
||||||
type SessionId = u32;
|
type SessionId = u32;
|
||||||
|
|
||||||
struct User {
|
struct User {
|
||||||
session: u32, // mumble session id
|
session: u32, // mumble session id
|
||||||
ssrc: u32, // ssrc id
|
ssrc: u32, // ssrc id
|
||||||
active: bool, // whether the user is currently transmitting audio
|
active: bool, // whether the user is currently transmitting audio
|
||||||
timeout: Option<Delay>, // assume end of transmission if silent until then
|
timeout: Option<Pin<Box<Sleep>>>, // assume end of transmission if silent until then
|
||||||
start_voice_seq_num: u64,
|
start_voice_seq_num: u64,
|
||||||
highest_voice_seq_num: u64,
|
highest_voice_seq_num: u64,
|
||||||
rtp_seq_num_offset: u32, // u32 because we also derive the timestamp from it
|
rtp_seq_num_offset: u32, // u32 because we also derive the timestamp from it
|
||||||
|
@ -70,7 +70,7 @@ impl User {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_active(&mut self, target: u8) -> Option<Frame> {
|
fn set_active(&mut self, target: u8) -> Option<Frame> {
|
||||||
self.timeout = Some(tokio::time::delay_for(Duration::from_millis(400)));
|
self.timeout = Some(Box::pin(tokio::time::sleep(Duration::from_millis(400))));
|
||||||
|
|
||||||
if self.active {
|
if self.active {
|
||||||
None
|
None
|
||||||
|
@ -587,8 +587,7 @@ impl Future for Connection {
|
||||||
// (same applies to the other futures directly below it)
|
// (same applies to the other futures directly below it)
|
||||||
for session in self.sessions.values_mut() {
|
for session in self.sessions.values_mut() {
|
||||||
if let Some(timeout) = &mut session.timeout {
|
if let Some(timeout) = &mut session.timeout {
|
||||||
pin_mut!(timeout);
|
if let Poll::Ready(()) = timeout.poll_unpin(cx) {
|
||||||
if let Poll::Ready(()) = timeout.poll(cx) {
|
|
||||||
if let Some(frame) = session.set_inactive() {
|
if let Some(frame) = session.set_inactive() {
|
||||||
self.outbound_buf.push_back(frame);
|
self.outbound_buf.push_back(frame);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,12 +37,6 @@ impl From<native_tls::Error> for Error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<tokio::time::Error> for Error {
|
|
||||||
fn from(e: tokio::time::Error) -> Self {
|
|
||||||
Error::Misc(Box::new(e))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<rtp::Error> for Error {
|
impl From<rtp::Error> for Error {
|
||||||
fn from(e: rtp::Error) -> Self {
|
fn from(e: rtp::Error) -> Self {
|
||||||
Error::Misc(Box::new(e))
|
Error::Misc(Box::new(e))
|
||||||
|
|
|
@ -21,7 +21,7 @@ use std::net::Ipv6Addr;
|
||||||
use std::net::ToSocketAddrs;
|
use std::net::ToSocketAddrs;
|
||||||
use tokio::net::TcpListener;
|
use tokio::net::TcpListener;
|
||||||
use tokio::net::TcpStream;
|
use tokio::net::TcpStream;
|
||||||
use tokio_tls::TlsConnector;
|
use tokio_native_tls::TlsConnector;
|
||||||
use tokio_tungstenite::accept_hdr_async_with_config;
|
use tokio_tungstenite::accept_hdr_async_with_config;
|
||||||
use tokio_util::codec::Decoder;
|
use tokio_util::codec::Decoder;
|
||||||
use tungstenite::handshake::server::{ErrorResponse, Request, Response};
|
use tungstenite::handshake::server::{ErrorResponse, Request, Response};
|
||||||
|
@ -179,7 +179,7 @@ async fn main() -> Result<(), Error> {
|
||||||
|
|
||||||
println!("Binding to port {}", ws_port);
|
println!("Binding to port {}", ws_port);
|
||||||
let socket_addr = (Ipv6Addr::from(0), ws_port);
|
let socket_addr = (Ipv6Addr::from(0), ws_port);
|
||||||
let mut server = TcpListener::bind(&socket_addr).await?;
|
let server = TcpListener::bind(&socket_addr).await?;
|
||||||
|
|
||||||
println!("Waiting for client connections..");
|
println!("Waiting for client connections..");
|
||||||
loop {
|
loop {
|
||||||
|
@ -212,6 +212,7 @@ async fn main() -> Result<(), Error> {
|
||||||
max_send_queue: Some(10), // can be fairly small as voice is using WebRTC instead
|
max_send_queue: Some(10), // can be fairly small as voice is using WebRTC instead
|
||||||
max_message_size: Some(0x7f_ffff), // maximum size accepted by Murmur
|
max_message_size: Some(0x7f_ffff), // maximum size accepted by Murmur
|
||||||
max_frame_size: Some(0x7f_ffff), // maximum size accepted by Murmur
|
max_frame_size: Some(0x7f_ffff), // maximum size accepted by Murmur
|
||||||
|
accept_unmasked_frames: false, // browsers should comply with RFC 6455
|
||||||
};
|
};
|
||||||
fn header_callback(
|
fn header_callback(
|
||||||
_req: &Request,
|
_req: &Request,
|
||||||
|
|
Loading…
Reference in a new issue