0

I'm creating a game application with a lobby. When the owner clicks "start" all of the lobby members are redirected to the game page. I have special socket.io disconnect code for the lobby page and the game page. How can I detect which page the client is coming from?

For clarification, it shouldn't be able to be modified client-side.

4

2 回答 2

0

You want detect client ip address or something else?

于 2013-11-11T03:41:15.490 回答
0

You can get the url of the client through

socket.handshake.headers.referer

and parse it with url.parse().

于 2013-11-11T04:05:00.320 回答