WebSocket流量编码(GZip) [英] WebSocket Traffic Encoding (GZip)

查看:529
本文介绍了WebSocket流量编码(GZip)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

StackOverflow在其所有页面上使用GZip编码;他们的websocket流量似乎也是如此,因为它似乎完全被混淆了。

StackOverflow uses the GZip encoding on all of their pages; the same seems to be true for their websocket traffic since it seems completely obfuscated.

他们如何/将使用什么来实现这一目标;而我需要做什么来实现相同的目标,因为我的websocket服务器托管在没有IIS等的独立服务器上?

How/What would they use to achieve this; rather what would I need to do to achieve the same since my websocket server is hosted on its own separate server without IIS etc?

值得注意的是 http压缩也没有在他们的websocket连接请求中设置。

Worth noting too that the http compression is not set on their websocket connection request either.

完整日志截图: http://i44.tinypic.com/19s4yr.jpg

推荐答案

根据RFC6455,必须屏蔽从客户端到服务器的WebSocket有效负载,不得屏蔽服务器到客户端。屏蔽是通过XORring有效负载和32位掩码完成的。你在日志中看到的值。

According to RFC6455, WebSocket payload from client to server MUST be masked, server to client MUST NOT be masked. The masking is done by XORring payload with 32 Bit mask .. the value you see in your log.

烹饪中有一个WS扩展,提供基于帧的压缩(紧缩)。这与掩蔽无关。每帧压缩的有效负载有效压缩有效负载,然后屏蔽有效负载(客户端到服务器)。

There is a WS extension in the cooking that provides frame-based compression (deflate). This has nothing to do with masking. Payload with per-frame-compression active compresses payload, and then masks payload (client to server).

这篇关于WebSocket流量编码(GZip)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆