Authorization in Socket IO
I am pretty much confused with the authorization in socket io.
I want to implement some way in which i am able to know that the client is a genuine one and not a spoofer. How can i do that???
Can i transfer a self generated key along with the handshake or socket.connect method???
Did you check out https://github.com/LearnBoost/socket.io/wiki/Authorizing ?
Yeah.. I am working on it but it is pretty confusing.. I mean i am not able to figure out how to pass headers during handshake and also i am not sure whether it will make sure that the client is genuine and not a spoofer.
Currently, I took the index file of an already implemented socket io and node implementation, copied the data, created a local file, changed the host in javascript from "null" to the "original host", and it got connected!!
PS, I am new to node and socket io and js too!!!
OK. I configured the origins parameter to accept the connections only from the required origins. Can anyone please confirm if there is anyway to modify the origin and access the data? I am just thinking in terms of security of the API which i am working on.
Btw Can someone tell me how can i set multiple origins in the set origin parameter??
This is the part of output when i log the socket object
settings: { origins: 'http://192.168.100.92,http://localhost', log: true, store: { options: undefined, clients: {}, manager: [Circular] }, logger: { colors: true, level: 3, enabled: true },
And this is what I get when i try to connect warn - illegal origin: http://192.168.100.92
Wonder why it is happening like this. It should accept the connections from this origin. The code works fine when allowed with all origins