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

websocket: Clarify the status of the package as retired #175

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mortie
Copy link

@mortie mortie commented May 28, 2023

The websocket package is retired, as explained in golang/go#2134 (comment), and its neglect has been a topic of discussion since at least 2016 (see golang/go#18152). However, to this day, the documentation on pkg.go.dev doesn't make the status of the package clear, as I pointed out in golang/go#60467.

This PR changes the wording to explicitly state that the package is in fact retired, as opposed to simply "lacking some features".

@google-cla
Copy link

google-cla bot commented May 28, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@binwiederhier
Copy link

@mortie There's a typo in your PR (maintained WebSoket package instead), and the linked WS package is also not well maintained.

@mortie
Copy link
Author

mortie commented Jul 24, 2023

@binwiederhier I fixed the typo.

I also replaced the link to nhooyr.io/websocket with a link to gorilla/websocket, since that's apparently no longer inactive; see gorilla/websocket@931041c and the announcement at https://github.com/gorilla.

@mortie
Copy link
Author

mortie commented Aug 9, 2023

There doesn't seem to be much interest in this. Should I just close the PR? Is the golang.org/x/net package unmaintained?

@ruyi789
Copy link

ruyi789 commented Aug 28, 2023

这个包满足我的,因为很小,而且是官方维护。唯一不足的地方大多数人没法用它,因为不会Read。

var c *websocket.Conn
var buf bytes.Buffer
b := make([]byte, 1024)

for {
	n, err := c.Read(b)

	if n > 0 {
		buf.Write(b[:n])
	} else if err != nil {
		return
	}

	//处理帧数据,你可能有如下三种判断之一:

	if err == io.EOF { //表示帧结束? 但是你可能永远等不到io.EOF这个值
		//处理帧数据
		buf.Reset()
	}

	//或者
	if buf.Len() == c.Len() { //c.Len()? 这方法返回没有准确表达我需要的条件,不知道有什么作用:frame.Length?
		//处理帧数据
		buf.Reset()
	}

	//或者
	if buf.Len() == int(c.FrameDataLenth()) { //ok,非常棒。但是 websocket.Conn 没有这个方法:FrameDataLenth=frame.header.Length
		//处理帧数据
		buf.Reset()
	}

}

@mortie
Copy link
Author

mortie commented Dec 20, 2023

Is this repo dead?

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