Re: WebSocket client and permessage-deflate compression



OK I think I got it. While the deflate feature is default active on the client side, the extension manager is not. And no manager -> no extensions -> no deflate. On the server side, the extensions seem to work w/o additional lines of code. To be honest, this was pretty hard to track down. The official doc didn't mention all that stuff, I got it all from staring at your regression test code.

With best regards

This is the modified client code block:

SoupSession *session = soup_session_new();
SoupMessage *message = soup_message_new("GET", "ws://localhost:10666");
if (!soup_session_has_feature(session, SOUP_TYPE_WEBSOCKET_EXTENSION_MANAGER)) {
    g_message("added extension manager");
    soup_session_add_feature_by_type(session, SOUP_TYPE_WEBSOCKET_EXTENSION_MANAGER);
}
if (!soup_session_has_feature(session, SOUP_TYPE_WEBSOCKET_EXTENSION_DEFLATE)) {
    g_message("added extension deflate");
    soup_session_add_feature_by_type(session, SOUP_TYPE_WEBSOCKET_EXTENSION_DEFLATE);
}
soup_session_websocket_connect_async(session, message, NULL, NULL, NULL, connected_cb, NULL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]