Socket.io “无法接收”;auth";SocketIO客户端的参数

Socket.io “无法接收”;auth";SocketIO客户端的参数,socket.io,Socket.io,这就是我访问SocketIO服务器的方式 var socket = io('http://localhost:3001', { query: { token : "XXXX" }, withCredentials: false, allowEIO3: true, auth: { token: "abc" } }); 在后端,我得到的是query,但不是auth参数: {"headers":{&q

这就是我访问SocketIO服务器的方式

var socket = io('http://localhost:3001', {
  query: {
    token : "XXXX"
  },
  withCredentials: false,
  allowEIO3: true,
  auth: {
    token: "abc"
  }
});
在后端,我得到的是
query
,但不是
auth
参数:

{"headers":{"host":"localhost:3001","user-agent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0","accept":"*/*","accept-language":"en-US,en;q=0.5","accept-encoding":"gzip, deflate","origin":"http://localhost:4001","dnt":"1","connection":"keep-alive","referer":"http://localhost:4001/","sec-gpc":"1"},"time":"Tue Jun 01 2021 22:29:48 GMT+0530 (India Standard Time)","address":"::ffff:127.0.0.1","xdomain":true,"secure":false,"issued":1622566788895,"url":"/socket.io/?token=XXXX&EIO=3&transport=polling&t=Nd8X5xy","query":{"token":"XXXX","EIO":"3","transport":"polling","t":"Nd8X5xy"}}