#208·ws

Reading incoming data frame with extension enabled

Author: wen-git-accCreated Jan 27, 2025Updated Jan 27, 2025

Hi there,

I am using this library for my websocket connection and establish connection with the server with deflate header. Doing so, I am facing problem with reading the compressed data from the server. Is there anyway to read the server data with when establishing connection with deflate (permessage-deflate) extension?

flateOption := httphead.Option{
		Name:       wsflate.DefaultParameters.Option().Name,
		Parameters: wsflate.DefaultParameters.Option().Parameters,
	}
	source.dialer.Extensions = []httphead.Option{
		flateOption,
	}

I am using wsutil.ReadServerData(conn) to read server data.