New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Origins , where is your api docs? #39
Comments
anything, lol.. |
$io = new SocketIO(2020);
$io->origins('http://example.com:8080'); Sorry for the delay. |
Thanks, can an array be passed of Domains that can connect to my app? Also, where is the api..? |
I need to get the socket.id I was thinking maybe i could find it calling $io->sockets->connected just like in socket.io but was not property of $io.. Any help? |
Multiple origins like this. $io = new SocketIO(2020);
$io->origins('http://domain.com:* http://domain.org:* http://domain.net:* http://domain.gov:*'); You can get socket.id just by More api please see http://socket.io/docs/server-api/ . |
I know about $socket->id i am talking about getting other sockets connected and the work with their socket, Beside that api is for socket.io node , u mean that ur project trasnlate to same api? |
Yes , this porject is just trasnlate socket.io by workerman. |
Ah, i see let play with it and see how it goes. |
Also, will be good idea if u comment this in the readme of your project... Would help a lot.. |
Thank you for your suggestion. |
Ok, I played a bit with $io->origins('http://my-domain.com:*'); and still let me connect which is not the domain I want it to be allowed... in my other app I have in Javascript, io = io.listen(server ,{
origins : function( origin, fn ){
if( u.Ar_contains( options.domains , origin ) ){
return fn( null, true );
}else{
return fn( null, false );
}
}
} which restrict and allow only those domain I want to connect to my app.. Can you help me on this?, thanks for your help |
https://github.com/walkor/phpsocket.io/blob/master/src/Engine/Engine.php#L159 Here are the codes deal with origin, May be you can debug by your self. : ) |
I don't seem to have that method::checkRequest , is that the upcoming version you are working on? Or I don't have the current version.. how do I find out.. Yes, just find out I don't have the current, had to download current from master to have the current code.. playing around a bit now.. Origin test doesn't work... |
Hi, @walkor hope you are fine..
Can you post the link where you phpsocket.io api is located, I am trying to restrict ORIGIN to my domain, can you tell me how is this accomplished?
regards
The text was updated successfully, but these errors were encountered: