mirror of
https://github.com/MeexReay/bRAC.git
synced 2025-06-24 10:52:58 +03:00
Compare commits
5 Commits
5b23a3bd70
...
f3b6cbd01c
Author | SHA1 | Date | |
---|---|---|---|
f3b6cbd01c | |||
956612b192 | |||
16d7cf0b29 | |||
9a191eec78 | |||
bbbcb93a7f |
@ -13,6 +13,7 @@ better RAC client
|
|||||||
- RACv1.99.x and RACv2.0 compatible
|
- RACv1.99.x and RACv2.0 compatible
|
||||||
- WRAC compatible ([docs](docs/wrac.md))
|
- WRAC compatible ([docs](docs/wrac.md))
|
||||||
- chat commands (type /help)
|
- chat commands (type /help)
|
||||||
|
- uses tor proxy as default (wracs://meex.lol:11234)
|
||||||
- no ip and date visible for anyone (almost)
|
- no ip and date visible for anyone (almost)
|
||||||
- coloring usernames by their clients (CRAB, clRAC, Mefidroniy, etc.)
|
- coloring usernames by their clients (CRAB, clRAC, Mefidroniy, etc.)
|
||||||
- many command-line options (see --help)
|
- many command-line options (see --help)
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use serde_default::DefaultFromSerde;
|
use serde_default::DefaultFromSerde;
|
||||||
use serde_yml;
|
use serde_yml;
|
||||||
use std::str::FromStr;
|
|
||||||
use std::{fs, path::PathBuf};
|
use std::{fs, path::PathBuf};
|
||||||
|
|
||||||
const MESSAGE_FORMAT: &str = "\u{B9AC}\u{3E70}<{name}> {text}";
|
const MESSAGE_FORMAT: &str = "\u{B9AC}\u{3E70}<{name}> {text}";
|
||||||
@ -22,7 +21,7 @@ pub fn default_konata_size() -> usize {
|
|||||||
100
|
100
|
||||||
}
|
}
|
||||||
pub fn default_host() -> String {
|
pub fn default_host() -> String {
|
||||||
"wracs://meex.lol".to_string()
|
"wracs://meex.lol:11234".to_string()
|
||||||
}
|
}
|
||||||
pub fn default_message_format() -> String {
|
pub fn default_message_format() -> String {
|
||||||
MESSAGE_FORMAT.to_string()
|
MESSAGE_FORMAT.to_string()
|
||||||
|
@ -46,6 +46,7 @@ lazy_static! {
|
|||||||
];
|
];
|
||||||
|
|
||||||
pub static ref SERVER_LIST: Vec<String> = vec![
|
pub static ref SERVER_LIST: Vec<String> = vec![
|
||||||
|
"wracs://meex.lol:11234".to_string(),
|
||||||
"rac://meex.lol".to_string(),
|
"rac://meex.lol".to_string(),
|
||||||
"wracs://meex.lol".to_string(),
|
"wracs://meex.lol".to_string(),
|
||||||
"rac://91.192.22.20".to_string()
|
"rac://91.192.22.20".to_string()
|
||||||
|
@ -8,7 +8,7 @@ use std::{
|
|||||||
|
|
||||||
use native_tls::{TlsConnector, TlsStream};
|
use native_tls::{TlsConnector, TlsStream};
|
||||||
use socks::Socks5Stream;
|
use socks::Socks5Stream;
|
||||||
use tungstenite::WebSocket;
|
use tungstenite::{client::client_with_config, protocol::WebSocketConfig, WebSocket};
|
||||||
|
|
||||||
pub mod rac;
|
pub mod rac;
|
||||||
pub mod wrac;
|
pub mod wrac;
|
||||||
@ -177,13 +177,14 @@ pub fn connect(host: &str, proxy: Option<String>) -> Result<RacStream, Box<dyn E
|
|||||||
stream
|
stream
|
||||||
};
|
};
|
||||||
|
|
||||||
stream.set_read_timeout(Duration::from_secs(3));
|
stream.set_read_timeout(Duration::from_secs(15)); // TODO: softcode this
|
||||||
stream.set_write_timeout(Duration::from_secs(3));
|
stream.set_write_timeout(Duration::from_secs(15));
|
||||||
|
|
||||||
if wrac {
|
if wrac {
|
||||||
let (client, _) = tungstenite::client(
|
let (client, _) = client_with_config(
|
||||||
&format!("ws{}://{host}", if ssl { "s" } else { "" }),
|
&format!("ws{}://{host}", if ssl { "s" } else { "" }),
|
||||||
stream,
|
stream,
|
||||||
|
Some(WebSocketConfig::default().max_message_size(Some(512 * 1024 * 1024))), // TODO: softcode this
|
||||||
)?;
|
)?;
|
||||||
Ok(RacStream::WRAC(client))
|
Ok(RacStream::WRAC(client))
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user