Skip to content

Where can I set the authentication token? #62

@katsuo555

Description

@katsuo555

I am developing a application of two-way communication in SocketIO between App of iPhone and server.

I would like to implement the authentication function when connecting from the application side to the chat server.

I have implemented on the server side as described below.

io.set('authorization', function (handshakeData, callback) {

    var token = handshakeData.query.token;

    checkAuthToken(token, callback);

});

However, I do not know where I should set the token in the app side.

var socket:SIOSocket! = nil

SIOSocket.socketWithHost("ServerUrl" , response: { (_socket: SIOSocket!) in
    self.socket = _socket

    println(self.socket)

    self.socket.onConnect = {() in
       println("connected")

    }
})

To borrow your wisdom.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions