-
Notifications
You must be signed in to change notification settings - Fork 47
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
协议设计的一些想法 #8
Comments
计划上行第一个字节做协议类型来实现兼容。 但是返回文本的状态码没见到过先例吧。有看到什么项目这样做的例子么 |
websocket协议的握手过程就是双方互发文本,握手完成后后续使用二进制协议。 |
The handshake from the client looks as follows:
The handshake from the server looks as follows:
|
同时带了版本信息 |
[4ecd323] 并开始支持WebSocket |
这代码几乎有 10 年了,似乎已经不再用于生产环境。@tomasen 还在心动不? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
目前的设计是初始化连接时用换行文本协议,如果初始化失败则回发二进制的错误码。
我在想,既然初始化已经用到文本协议了,何不连状态码返回也一起用文本协议,反正状态码也没几个字节。
还有一点是连接成功没有成功对应的状态码返回。
如果连接成功失败都有文本的状态码返回,就可以比较方便的用telnet做测试,手工发送一条连接初始化信息,在telnet可以直接看到服务端回发什么数据。
另外,是否需要在开头加个协议版本号,方便将来协议升级向下兼容不同版本的客户端?
The text was updated successfully, but these errors were encountered: