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