Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to split the websocket after upgrade? #93

Open
szguoxz opened this issue Dec 8, 2024 · 3 comments
Open

How to split the websocket after upgrade? #93

szguoxz opened this issue Dec 8, 2024 · 3 comments

Comments

@szguoxz
Copy link

szguoxz commented Dec 8, 2024

Is it possible?

@bigvo
Copy link

bigvo commented Dec 9, 2024

Refer to examples:

    let (mut ws, _) =
        fastwebsockets::handshake::client(&SpawnExecutor, req, tls_stream).await?;
    ws.set_auto_pong(false);
    ws.set_auto_close(false);
    let (rx, tx) = ws.split(tokio::io::split);
    let rx = FragmentCollectorRead::new(rx);
    Ok((rx, tx))

@szguoxz
Copy link
Author

szguoxz commented Dec 10, 2024

Thanks, It won't work until I added the unstable_split feature. Does it work for you with default setup?

@bigvo
Copy link

bigvo commented Dec 10, 2024

This is correct, unstable_split has to be added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants