miwoy / weapp-node-tunnel

小程序nodejs版本信道服务
MIT License
11 stars 6 forks source link

缺少tunnelId #6

Open rayyzhong opened 3 years ago

rayyzhong commented 3 years ago

image

socket建立连接时,是通过url参数提交tunnelId的,

wss://domain.com/?tunnelId=e6ff4f5e-219e-4582-8eb7-b828361ab9ae&tcId=7d73ae32b755aed8bc9a5b084525fb72

但看代码像是从cookie里拿,这里是不是需要优化?

https://github.com/miwoy/weapp-node-tunnel/blob/75b9c309cd6fdbecfa6db95b7ec0ace458050f78/middleware/auth.js#L14

miwoy commented 3 years ago

cookie中间件有处理url参数,同时支持cookie和url参数两种方式传递 https://github.com/miwoy/weapp-node-tunnel/blob/75b9c309cd6fdbecfa6db95b7ec0ace458050f78/middleware/cookies.js#L4