简体   繁体   中英

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

var socket = io('http://192.168.1.120:3000/socket', {query: user});

where user is an json object with data

I want to be able to do the same in java, I am using the library nkzawa socket.io-client

Thank you

@nkzawa replied me in the repository

https://github.com/nkzawa/socket.io-client.java/issues/33

I just need to add the parameters to the URL

IO.socket("http://SERVER_URL:3000/socket?userid=100");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM