[英]Add custom params on nkzawa socket.iO-client for the handshake
I want to be able to add custom params in the client for the handshake. 我希望能够在客户端中为握手添加自定义参数。
In the html client I am doing this 在html客户端中,我正在执行此操作
var socket = io('http://192.168.1.120:3000/socket', {query: user});
where user is an json object with data 用户是带有数据的json对象
I want to be able to do the same in java, I am using the library nkzawa socket.io-client 我希望能够在Java中执行相同操作,我正在使用库nkzawa socket.io-client
Thank you 谢谢
@nkzawa replied me in the repository @nkzawa在存储库中回复了我
https://github.com/nkzawa/socket.io-client.java/issues/33 https://github.com/nkzawa/socket.io-client.java/issues/33
I just need to add the parameters to the URL 我只需要将参数添加到URL
IO.socket("http://SERVER_URL:3000/socket?userid=100");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.