从Javascript访问Chrome的内部gzip例程 [英] Access Chrome's internal gzip routine from Javascript
问题描述
我想在JavaScript中压缩一些数据,然后发送给服务器通过WebSocket和Chrome内置的deflate例程肯定会比我能用Javascript编写的任何东西都快。
基于 基于在堆栈溢出问题的这个答案上,手动将gzip应用于WebSocket是完全没有必要的。从版本19开始,当服务器支持它时,Chrome显然会自动压缩WebSocket流量。All modern browsers include gzip routines for exchanging compressed data with servers. Can anyone point me in the right direction for writing a Chrome extension that would allow Javascript to leverage this routine?
I would like to compress some data in Javascript before sending it to the server over a WebSocket, and Chrome's built in deflate routine would certainly be faster than anything I could write in Javascript.
Based on this answer to a Stack Overflow question, manually applying gzip to a WebSocket is completely unnecessary. As of version 19, Chrome will apparently compress WebSocket traffic automatically when the server supports it.
这篇关于从Javascript访问Chrome的内部gzip例程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!