websocket with cookie or session #881
Unanswered
FlaviuRadulescu
asked this question in
Q&A
Replies: 2 comments 1 reply
-
Workerman's websocket does not need session cookies. You can store data on the connection object, and these data can be obtained from the connection object at any time. For example $worker = new Worker('websocket://0.0.0.0:1234');
$worker->onMessage = function($connection, $data)
{
$connection->send($connection->lastData ?? 'none');
$connection->lastData = $data;
}; |
Beta Was this translation helpful? Give feedback.
1 reply
-
I have no experience in using haproxy. I generally use nginx proxy to achieve load balancing. The configuration is similar to this.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
is there a way to implement some kind of session, cookie, unique identifier of a websocket connection/browser? I want to be able to identify websocket sesion behind a non sticky ha proxy so that I could route the request to any backend server?
If a browser reconnect after a temporary internet connection fault, I would like to be able to identify which was the browser session before the internet problem.
Thank you,
F
Beta Was this translation helpful? Give feedback.
All reactions