> For the complete documentation index, see [llms.txt](https://socket.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://socket.gitbook.io/docs/4-fu-wu-duan-apiserverapi/4.3-socket/socket_compress_value.md).

# 4.3.20 socket\_compress\_value

* `value` (Boolean) 是否压缩以下数据包
* **Returns** 连接`socket`

为后续事件设置一个修饰符，该修饰符只在值为`true`时压缩事件数据。不调用方法时默认为`true`。

```javascript
io.on('connection',socket=>{
    socket.compress(false).emit('uncompressed',"that's rough")
})
```
