Skip to content

API question #33

@Aymsd

Description

@Aymsd

In file: oatpp-websocket/Handshaker.hpp

Question

First of all I want to thank you for this amazing framework.
I have a small question regarding a use case of oat++ websocket.
in my case I'm trying to set up a websocket (with stomp) I have almost made it work but I'm still missing a header while doing the handshake.
The header I'm missing in this case is "Sec-WebSocket-Protocol" this one is expected from the client's side.
My issue is that I cannot add a header using the putHeader function. as soon as I do that the Handshake does not happen anymore.
Here is a sample of my controller. I'm guessing that I should not do it in an Action act(). But what would be the solution then please ?

`

ENDPOINT_ASYNC("GET", "PPLATFORM", WS){

    ENDPOINT_ASYNC_INIT(WS)

        Action act() override{
auto response = oatpp::websocket::Handshaker::serversideHandshake(request->getHeaders(), controller->websocketConnectionHandler);
response->putHeader("Sec-WebSocket-Protocol", "v11.stomp");   /* This is my issue */

return _return(response);
}

}

`

Thank you so much in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions