mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-25 09:59:21 +02:00
add simple websocket example
This commit is contained in:
@ -148,11 +148,11 @@ pub struct HttpChannel<T: 'static, A: 'static> {
|
||||
keepalive_timer: Option<Timeout>,
|
||||
}
|
||||
|
||||
impl<T: 'static, A: 'static> Drop for HttpChannel<T, A> {
|
||||
/*impl<T: 'static, A: 'static> Drop for HttpChannel<T, A> {
|
||||
fn drop(&mut self) {
|
||||
println!("Drop http channel");
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
impl<T, A> Actor for HttpChannel<T, A>
|
||||
where T: AsyncRead + AsyncWrite + 'static, A: 'static
|
||||
|
@ -129,7 +129,9 @@ impl StaticFiles {
|
||||
impl<S: 'static> RouteHandler<S> for StaticFiles {
|
||||
|
||||
fn set_prefix(&mut self, prefix: String) {
|
||||
self.prefix += &prefix;
|
||||
if prefix != "/" {
|
||||
self.prefix += &prefix;
|
||||
}
|
||||
}
|
||||
|
||||
fn handle(&self, req: HttpRequest, payload: Payload, state: Rc<S>) -> Task {
|
||||
|
@ -49,7 +49,7 @@
|
||||
//! {
|
||||
//! match msg {
|
||||
//! ws::Message::Ping(msg) => ws::WsWriter::pong(ctx, msg),
|
||||
//! ws::Message::Text(text) => ws::WsWriter::text(ctx, text),
|
||||
//! ws::Message::Text(text) => ws::WsWriter::text(ctx, &text),
|
||||
//! ws::Message::Binary(bin) => ws::WsWriter::binary(ctx, bin),
|
||||
//! _ => (),
|
||||
//! }
|
||||
|
Reference in New Issue
Block a user