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

docs: socket.io-auth.js #2340

Closed
wants to merge 12 commits into from
Closed

docs: socket.io-auth.js #2340

wants to merge 12 commits into from

Conversation

jingmingji
Copy link

官方文档socket.io实例—p2p聊天,中间件auth.js里面socket.join(room)放到了nsp.adapter.clients()里面有问题,导致clients返回到前端无法正常携带当前的socket信息,应该把socket.join(room)放到nsp.adapter.clients()外面先执行,亲测如此可以正常返回clients数据。另外clients[id] = query这个操作和插件本身的操作有冲突,因为socket.join(room)调用成功后,会自动将socketid放入到clients数组里面。如果想添加多余的信息可以通过其他字段来返回,没必要对这个插件会调用的属性进行操作。

jingmingji and others added 10 commits April 8, 2018 15:07
1、socket.join(room)放到了nsp.adapter.clients()里面有问题,导致clients返回到前端无法正常携带当前的socket信息,应该把socket.join(room)放到nsp.adapter.clients()外面先执行,亲测如此可以正常返回clients数据。
2、另外clients[id] = query,这个操作和插件本身的操作有冲突,因为socket.join(room)调用成功后,会自动将socketid放入到clients数组里面。如果想添加多余的信息可以通过其他字段来返回,没必要对这个插件会调用的属性进行操作。
@jingmingji jingmingji changed the title 关于官方文档socket.io部分的纠错 docs:socket.io部分的纠错 Apr 8, 2018
@jingmingji jingmingji changed the title docs:socket.io部分的纠错 docs: socket.io-auth.js Apr 8, 2018
@codecov
Copy link

codecov bot commented Apr 8, 2018

Codecov Report

Merging #2340 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2340   +/-   ##
=======================================
  Coverage   99.61%   99.61%           
=======================================
  Files          29       29           
  Lines         773      773           
=======================================
  Hits          770      770           
  Misses          3        3

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ba708ca...568af38. Read the comment docs.

@thonatos
Copy link
Member

thonatos commented Apr 8, 2018

#2338

@popomore popomore requested a review from ngot April 11, 2018 16:21
@thonatos
Copy link
Member

#2354 更新过了,这边关了,辛苦了

@thonatos thonatos closed this Apr 12, 2018
@koybe
Copy link

koybe commented Aug 2, 2018

@thonatos uws的npm包是deprecated的,稳定性怎么样

@thonatos
Copy link
Member

thonatos commented Aug 3, 2018

@koybe

很久没用了,不大确定,之前用它是因为在 ff 上兼容性有问题。
既然是 deprecated 了,就用回默认的吧,不过,理论上向下兼容吧?最好测试一下

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

Successfully merging this pull request may close these issues.

3 participants