How to use WsSessionState in Actix websocket client?

#1

I’ve tried a lot of methods, but they don’t work.

0 Likes

#2

You’re probably going to need to provide more details in order to get meaningful responses.

0 Likes

#3


can`t find state function in websocket client

0 Likes

#4

what do your extern and use statements look like? The code for the WS chat example includes the comment

/// This is our websocket route state, this state is shared with all route
/// instances via HttpContext::state()

You could see if adding the HttpContext:: path to your call of the state() function helps.

1 Like

#5

Thank you for your reply. I’ll try it.

0 Likes