Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to WebSocket dial: unsupported permessage-deflate parameter: "server_max_window_bits=15" #351

Closed
1770697081 opened this issue Oct 19, 2022 · 15 comments
Milestone

Comments

@1770697081
Copy link

I use this lib connect binance,2022.10.18 find this question。And then insert some code then can Bypass the problem。
dial.go ->verifyServerExtensions()

	for _, p := range ext.params {
		switch p {
		case "client_no_context_takeover":
			copts.clientNoContextTakeover = true
			continue
		case "server_no_context_takeover":
			copts.serverNoContextTakeover = true
			continue
		}
                //add code
		if strings.HasPrefix(p, "server_max_window_bits") {
			fmt.Println("server_max_window_bits:", p)
			continue
		}
		return nil, fmt.Errorf("unsupported permessage-deflate parameter: %q", p)
	}
    我在使用此包连接binance币安时,最近出现标题的错误,然后我尝试在websocket包的dial.go文件的verifyServerExtensions()函数中添加了兼容server_max_window_bits字段的代码,然后就能使用了。我看文档这字段功能好像是压缩之类的功能,不确定是否后续会出现新问题.
   抱歉,英文太菜了。
@faof
Copy link

faof commented Oct 19, 2022

我直接注释了这个,跑起来没问题

@1770697081
Copy link
Author

不确定以后服务器更新后,会不会导致客户端无法使用。可能现在服务端只是回复了此字段,但是没有实际使用这个内容。

@guotie
Copy link

guotie commented Oct 20, 2022

same problem.

@guotie
Copy link

guotie commented Oct 20, 2022

seem nobody maintains this repo?

0xbentang pushed a commit to 0xbentang/websocket that referenced this issue Oct 20, 2022
@LiYisen
Copy link

LiYisen commented Oct 20, 2022

same problem.

@nightwolfz
Copy link

@guotie Don't expect maintainers to respond this fast lol they not paid

Just disable compression. Should work.

@LiYisen
Copy link

LiYisen commented Oct 21, 2022

@guotie Don't expect maintainers to respond this fast lol they not paid

Just disable compression. Should work.

how to disable compression

@kunsonx
Copy link

kunsonx commented Oct 24, 2022

Check on this library: https://github.com/crypto-zero/go-binance

@felbit
Copy link

felbit commented Mar 5, 2023

Disabling compression did it for me, thanks @nightwolfz!

I have had the issue on client side and had to set CompressionMode in the DailOptions:

conn, _, err := websocket.Dial(ctx, ADDR, &websocket.DialOptions{
	CompressionMode: websocket.CompressionDisabled,
})

@nhooyr
Copy link
Contributor

nhooyr commented Mar 5, 2023

Going to just disable compression by default.

@nhooyr
Copy link
Contributor

nhooyr commented Sep 28, 2023

Disabled by default in #256

@nhooyr nhooyr closed this as completed Sep 28, 2023
@nhooyr
Copy link
Contributor

nhooyr commented Sep 28, 2023

Perhaps in regards to this specific issue, I should allow server_max_window_bits=15 and client_max_window_bits=15 as that's the default window size.

@nhooyr nhooyr reopened this Sep 28, 2023
@nhooyr nhooyr added this to the v1.9.0 milestone Sep 28, 2023
@nhooyr
Copy link
Contributor

nhooyr commented Oct 13, 2023

Dev should work now with binance out of the box though. Let me know if it doesn't. v1.8.8 is soon to be released.

@nhooyr
Copy link
Contributor

nhooyr commented Oct 13, 2023

Ah looks like the fix is here already: #258

@nhooyr
Copy link
Contributor

nhooyr commented Oct 13, 2023

Done with #258

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants