in reply to how Mojo::ua work with Net::Stomp
In the end you will have to learn about the Stomp payloads you will be using. The Javascript sends some string msg:
client.send(roomid, {}, msg);
Net::Stomp also sends some string with ->send.
With Mojo::UserAgent this would likely look like the following, as taken straight from the documentation:
$ua->start($tx => sub ($ua, $tx) { say 'WebSocket handshake failed!' and return unless $tx->is_websoc +ket; $tx->on(message => sub ($tx, $msg) { say "WebSocket message: $msg"; $tx->finish; }); $tx->send('some msg'); });
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how Mojo::ua work with Net::Stomp
by Anonymous Monk on Oct 14, 2023 at 10:07 UTC |