sosistab3_obfsws/
lib.rs

1pub mod pipe;
2pub mod listener;
3
4pub use pipe::ObfsWsPipe;
5pub use listener::ObfsWsListener;
6
7pub mod ws {
8    pub use async_tungstenite::{accept_hdr_async_with_config, WebSocketStream};
9    pub use async_tungstenite::tungstenite::http::Uri;
10    pub use async_tungstenite::tungstenite::handshake::client::Request;
11    pub use async_tungstenite::tungstenite::handshake::server::{Response, ErrorResponse, Callback};
12    pub use async_tungstenite::async_std::{
13        //connect_async_with_config,
14        client_async_tls_with_connector_and_config,
15        ConnectStream,
16    };
17    pub use async_tungstenite::tungstenite::protocol::{WebSocketConfig, Message};
18    pub use async_tungstenite::stream::Stream;
19
20    pub type WS = WebSocketStream<ConnectStream>;
21
22    #[allow(deprecated)]
23    pub const CONFIG: WebSocketConfig =
24        WebSocketConfig {
25            // 1) has been deprecated by the author of that websocket library.
26            // 2) But still needed, otherwise rustc compilation will fail (error[E0063]: missing struct field).
27            // 3) it's really a clumsy and useless design by Rust team.
28            max_send_queue: None,
29
30            // disable buffer
31            write_buffer_size: 0,
32            max_write_buffer_size: usize::MAX,
33
34            // cancel the message limit
35            max_message_size: None,
36            max_frame_size: None,
37
38            // accept client message that is unmasked
39            accept_unmasked_frames: true,
40        };
41}
42
43pub use sillad::Pipe;
44pub use sillad::listener::Listener as PipeListener;
45
46pub use pin_project::pin_project;