Skip to content

Latest commit

 

History

History
12 lines (9 loc) · 340 Bytes

socket_compress_value.md

File metadata and controls

12 lines (9 loc) · 340 Bytes

socket.compress(value)

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

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

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