Skip to content

websocket extension unable to connect #1231

Answered by Telroshan
Mr-Destructive asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks! It worked.
I'm... confused 😆

<div ws-connect="/chat/{{ slug }}/">
    <form ws-send>
        <input name="message">
    </form>
</div>

This works just fine in my case in your project.
Note I omitted hx-ext="ws" here since you already define it on your body, which would otherwise simply cause the messages to appear twice when writing in the chat but would still work.

I opened 2 tabs, I correctly get messages on both of them...

Could you please make sure that you are including the extension script as per the documentation when trying to use the extension?
I had to add the script here ofc but I don't know if that's because you had reverted to the legacy attribute, or if you had omitt…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@Mr-Destructive
Comment options

@Telroshan
Comment options

@Mr-Destructive
Comment options

@Telroshan
Comment options

Answer selected by Mr-Destructive
@Mr-Destructive
Comment options

@Telroshan
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants