sacOO7 / socketcluster-client-java

Native java and android client for socketcluster framework in node.js
http://socketcluster.io/
Apache License 2.0
94 stars 43 forks source link

auth before connect to socket connection #38

Closed miladr0 closed 6 years ago

miladr0 commented 6 years ago

hi in socket.io i use this way for auth before connect to socket.

IO.Options options = new IO.Options(); options.query = "token=" + token; socket = IO.socket(SERVER_ADDRESS, options); socket.connect(); can i user this way with this library?

sacOO7 commented 6 years ago

You can use setAuthToken method on the socket to set token, before connecting to server.

On Fri, Jul 20, 2018 at 1:50 AM Milad Ranjbar notifications@github.com wrote:

hi in socket.io i use this way for auth before connect to socket. IO.Options options = new IO.Options(); options.query = "token=" + token; socket = IO.socket(SERVER_ADDRESS, options); socket.connect(); can i user this way with this library?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sacOO7/socketcluster-client-java/issues/38, or mute the thread https://github.com/notifications/unsubscribe-auth/AP8vSW2YvVZ888vIoZCXMXC6v0dX7E9eks5uIOoNgaJpZM4VXCBK .

sacOO7 commented 6 years ago

Hi @miladr0 , will close the issue, if your problem is resolved 👍 . Please let me know your updates on this.

miladr0 commented 6 years ago

hi @sacOO7 , i couldn't solved the problem according to your suggestion, so i stick to socket.io, thanks anyway.

sacOO7 commented 6 years ago

Ohh no problem @miladr0 , please let me know if you use socketcluster in future and face any problem again 👍.

AnkitPat commented 5 years ago

hello @sacOO7

How to set multiple option in your library.

I have option like this:

{ hostname: 'chat.xxx.com', secure: true, port: 5001, rejectUnauthorized: false // Only necessary during debug if using a self-signed certificate }