ws gzip
This commit is contained in:
parent
f850a8806b
commit
40ca99d185
@ -6,7 +6,6 @@
|
||||
* can't reset password without knowing password =\
|
||||
* ws gzip encoding
|
||||
|
||||
* skip faceoff for practice
|
||||
* concede round
|
||||
|
||||
* look into ruin event bug
|
||||
|
||||
@ -34,7 +34,7 @@ router = "0.6"
|
||||
mount = "0.4"
|
||||
cookie = "0.12"
|
||||
crossbeam-channel = "0.3"
|
||||
ws = { version = "0.8", features = ["ssl"] }
|
||||
ws = { version = "0.8", features = ["ssl", "permessage-deflate"] }
|
||||
|
||||
lettre = "0.9"
|
||||
lettre_email = "0.9"
|
||||
|
||||
@ -16,6 +16,7 @@ use stripe::{Client as StripeClient, Subscription};
|
||||
|
||||
use crossbeam_channel::{unbounded, Sender as CbSender};
|
||||
use ws::{Builder, CloseCode, Message, Handler, Request, Response, Settings, Sender as WsSender};
|
||||
use ws::deflate::DeflateHandler;
|
||||
|
||||
use account::{Account};
|
||||
use account;
|
||||
@ -448,7 +449,8 @@ impl Handler for Connection {
|
||||
|
||||
pub fn start(pool: PgPool, events_tx: CbSender<Event>, stripe: StripeClient) {
|
||||
let mut rng = thread_rng();
|
||||
Builder::new()
|
||||
|
||||
let ws = Builder::new()
|
||||
.with_settings(Settings {
|
||||
max_connections: 10_000,
|
||||
..Settings::default()
|
||||
@ -478,14 +480,16 @@ pub fn start(pool: PgPool, events_tx: CbSender<Event>, stripe: StripeClient) {
|
||||
}
|
||||
});
|
||||
|
||||
Connection {
|
||||
id: rng.gen::<usize>(),
|
||||
account: None,
|
||||
ws: tx,
|
||||
pool: pool.clone(),
|
||||
stripe: stripe.clone(),
|
||||
events: events_tx.clone(),
|
||||
}
|
||||
DeflateHandler::new(
|
||||
Connection {
|
||||
id: rng.gen::<usize>(),
|
||||
account: None,
|
||||
ws: tx,
|
||||
pool: pool.clone(),
|
||||
stripe: stripe.clone(),
|
||||
events: events_tx.clone(),
|
||||
}
|
||||
)
|
||||
})
|
||||
.unwrap()
|
||||
.listen("127.0.0.1:40055")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user