Coder Social home page Coder Social logo

Comments (13)

Neumann-Valle avatar Neumann-Valle commented on May 17, 2024

anything, lol..

from phpsocket.io.

walkor avatar walkor commented on May 17, 2024
$io = new SocketIO(2020);
$io->origins('http://example.com:8080');

Sorry for the delay.

from phpsocket.io.

Neumann-Valle avatar Neumann-Valle commented on May 17, 2024

Thanks, can an array be passed of Domains that can connect to my app?

Also, where is the api..?

from phpsocket.io.

Neumann-Valle avatar Neumann-Valle commented on May 17, 2024

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?

from phpsocket.io.

walkor avatar walkor commented on May 17, 2024

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 $socket->id.

More api please see http://socket.io/docs/server-api/ .

from phpsocket.io.

Neumann-Valle avatar Neumann-Valle commented on May 17, 2024

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?

from phpsocket.io.

walkor avatar walkor commented on May 17, 2024

Yes , this porject is just trasnlate socket.io by workerman.
The api is almost the same as socket.io.

from phpsocket.io.

Neumann-Valle avatar Neumann-Valle commented on May 17, 2024

Ah, i see let play with it and see how it goes.

from phpsocket.io.

Neumann-Valle avatar Neumann-Valle commented on May 17, 2024

Also, will be good idea if u comment this in the readme of your project...

Would help a lot..

from phpsocket.io.

walkor avatar walkor commented on May 17, 2024

Thank you for your suggestion.
I will do that.

from phpsocket.io.

Neumann-Valle avatar Neumann-Valle commented on May 17, 2024

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?,
In your example I don't see where is being tested for allowed origins....

thanks for your help

from phpsocket.io.

walkor avatar walkor commented on May 17, 2024

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. : )

from phpsocket.io.

Neumann-Valle avatar Neumann-Valle commented on May 17, 2024

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...

from phpsocket.io.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.