Comments (13)
anything, lol..
from phpsocket.io.
$io = new SocketIO(2020);
$io->origins('http://example.com:8080');
Sorry for the delay.
from phpsocket.io.
Thanks, can an array be passed of Domains that can connect to my app?
Also, where is the api..?
from phpsocket.io.
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.
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.
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.
Yes , this porject is just trasnlate socket.io by workerman.
The api is almost the same as socket.io.
from phpsocket.io.
Ah, i see let play with it and see how it goes.
from phpsocket.io.
Also, will be good idea if u comment this in the readme of your project...
Would help a lot..
from phpsocket.io.
Thank you for your suggestion.
I will do that.
from phpsocket.io.
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.
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.
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)
- Live Demo link is not working! HOT 2
- heartbeat detection issue
- Cannot set it up with docker.
- $socket is null HOT 4
- After v1.1.13, phpsocket.io cannot be connected when a browser use WebSocket first HOT 3
- 如何推送所有在线用户消息,排除自己在外? HOT 1
- Compatibility with clue/redis-react HOT 4
- Cannot communicate back <=> front HOT 2
- GET 是空的 HOT 2
- use \Workerman\Lib\Timer is erroneous
- Workerman\Lib\Timer not found HOT 2
- Unable to setup phpsocket.io with Docker
- Update to socket v4 HOT 4
- error 4x installation info HOT 1
- SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:0A00009C:SSL routines::http request
- RFC6455 Socket implementation incompatible with ProtocolInterface HOT 1
- fread(): SSL: Connection reset by peer in HOT 3
- Multiple threads to allow for event listeners to work properly asynchronously
- Get parameter in connection
- How can I use PHP Socket.IO with Nginx/SSL or without SSL? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpsocket.io.