Skip to content

#692 Add the possibility to specify "Sec-WebSocket-Protocol" - #693

Merged
gittiver merged 11 commits into
CrowCpp:masterfrom
KaSSaaaa:ws-subprotocols
Sep 10, 2024
Merged

gittiver merged 11 commits into
CrowCpp:masterfrom
KaSSaaaa:ws-subprotocols

Conversation

@KaSSaaaa

Copy link
Copy Markdown
Contributor

I took the liberty to add some documentation as well. Feel free if you have any feedback :)

Comment thread include/crow/websocket.h Resolved
@MichaelSB

MichaelSB commented Jul 29, 2023 •

Copy link
Copy Markdown
Contributor

I could use your split function in my websocket compression PR, if yours is merged first :D

@KaSSaaaa

Copy link
Copy Markdown
Contributor Author

I rewrote find_first_of algorithm and put it in utility.h :)

@MichaelSB

Copy link
Copy Markdown
Contributor

If I don't miss it, I think a getter is needed for the selected subprotocol in the connection. Otherwise looks good to me.

@KaSSaaaa

Copy link
Copy Markdown
Contributor Author

Currently, the "subprotocol_" is only a private variable and is only used in the Connection::start but I can add a getter in the interface and implementation if it's needed.

@MichaelSB

Copy link
Copy Markdown
Contributor

I think that's it :) I asked for the getter, because users must be able to know which subprotocol was selected and probably switch code paths accordingly.

Comment thread include/crow/routing.h Resolved
Comment thread include/crow/websocket.h Resolved
@gittiver

Copy link
Copy Markdown
Member

build fails on ubuntu at least, other os will run later.

@KaSSaaaa

Copy link
Copy Markdown
Contributor Author

Apparently missed the include of for utility::find_first_of ...

@gittiver
gittiver requested a review from The-EDev January 18, 2024 15:44
@gittiver
gittiver requested a review from mrozigor January 29, 2024 17:03
@gittiver gittiver added the feature Code based project improvement label Jan 30, 2024
Comment thread include/crow/websocket.h Resolved
@mrozigor

mrozigor commented Mar 9, 2024

Copy link
Copy Markdown
Member

May I ask you also to add unit tests?

@KaSSaaaa

KaSSaaaa commented Sep 7, 2024

Copy link
Copy Markdown
Contributor Author

@mrozigor Sorry about the delay, been quite busy lately and totally forgot about that... Let me know if you need more tests !

@gittiver
gittiver merged commit 210cbfd into CrowCpp:master Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Code based project improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants