I can't send message with the wrapped Websocket Object #1840
Answered
by
matiboy
alejandrozf
asked this question in
Q&A
-
Hi guys I'm trying to use the wrapped Websocket object with the websocket extension when connection is made, I mean inside the event htmx:wsOpen but it is not working. I tried with send and with sendInmediatly but neither worked. I can send data by using input in forms but not using the wrapped websocket object This is the code I'm using:
Could you give me a hand with this? |
Beta Was this translation helpful? Give feedback.
Answered by
matiboy
Sep 28, 2023
Replies: 1 comment 1 reply
-
Hi @alejandrozf looking at the source code, it looks like you must pass a "sendingElt" argument to send and So evt.detail.socketWrapper.sendImmediately("some data 2", document.body); should do it |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
alejandrozf
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @alejandrozf looking at the source code, it looks like you must pass a "sendingElt" argument to send and
sendImmediately
otherwise they don't do anything.So
should do it