websocketpp icon indicating copy to clipboard operation
websocketpp copied to clipboard

validate_handler / wsServer::connection_ptr->set_body

Open loupus opened this issue 2 years ago • 0 comments

Hello, on validation handler, when websocket client is rejected, I can succesfully return a status_code to the client, however, I also would like to send some message giving an idea why it is rejected.

       con->set_body(wsjson.wsReject("unauthorized endpoint!"));
        con->set_status(websocketpp::http::status_code::unauthorized);
        return false;

on client side, i can see the status code, but not the message. Is there a way to define the response message body?

loupus avatar Feb 15 '23 14:02 loupus