Skip to content

actix_web_actors::ws::start don't accept Frame stream #3415

Open
@alaravel

Description

@alaravel

Hi
How I can pass awc stream to actix_web_actors::ws::start?
It's expected Result<Bytes, PayloadError> but framed is Result<Frame, ...>

let con=awc::Client::new()
        .ws(url)
        .connect().await;
   match con {
        Ok((mut res,mut framed)) => {
            let req=TestRequest::default()
                .insert_header(("sec-websocket-key",res.headers().get("sec-websocket-accept").unwrap()))
                .insert_header(("sec-websocket-version","13"))
                .insert_header(("connection","upgrade"))
                .insert_header(("upgrade","websocket"))
                .to_http_request();

            match actix_web_actors::ws::start(
                WsSession::new(id,room,addr),
                &req,
                framed //todo
            ){
                Ok(a) => {

                }
                Err(e) => {
                    println!("error ={:?}",e)
                }
            }
        }
        Err(_) => {}
    }

Your Environment

  • Rust Version (I.e, output of rustc -V):1.76.0
  • Actix Web Version:4.8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions