我如何自定义套接字重新连接url? 想要在重新连接url时添加一个请求参数

我想添加一个更多的请求参数重新连接url。

简单的连接url:

http://192.168.0.91:8155/socket.io/?EIO=3&transport=polling&t=1426834118026-12&sid=6STHOzvQ1APcl0igAAAA 

重新连接的url应该是:

 http://192.168.0.91:8155/socket.io/?EIO=3&transport=polling&t=1426834118026-12&sid=6STHOzvQ1APcl0igAAAA&token=xyz 

我有一个类似的问题,并通过更改套接字pipe理器中的uri来解决它。 我不知道这是否正确。

 // Connect to your socket var socket = io("your_url_here"); // And change the uri after that so it can be different in a reconnect attempt socket.io.uri = "your_new_url_here";