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