Open rayyzhong opened 3 years ago
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
cookie中间件有处理url参数,同时支持cookie和url参数两种方式传递 https://github.com/miwoy/weapp-node-tunnel/blob/75b9c309cd6fdbecfa6db95b7ec0ace458050f78/middleware/cookies.js#L4
socket建立连接时,是通过url参数提交tunnelId的,
但看代码像是从cookie里拿,这里是不是需要优化?
https://github.com/miwoy/weapp-node-tunnel/blob/75b9c309cd6fdbecfa6db95b7ec0ace458050f78/middleware/auth.js#L14