Commit Graph

361 Commits

Author SHA1 Message Date
Chris Boden
99285acca0 Merge branch 'benconnito' 2014-11-24 09:05:13 -05:00
Chris Boden
c179d60e77 Formatting, removed flash check 2014-11-23 11:40:06 -05:00
Ben Connito
f5d148cdc4 just strip the '.' from uniqid with added entropy. this way we dont run into any md5 collisions. 2014-09-15 17:01:24 -04:00
Ben Connito
a6e7952671 changed echos back to trigger_error 2014-09-14 11:59:46 -04:00
Chris Boden
1a47d4f5e4 Fix loss of query params in Router and unit test 2014-09-13 19:14:18 -04:00
Ben Connito
417017b667 remove local project folder from gitignore
in App::__construct use echo instead of trigger_error
2014-09-12 11:46:33 -04:00
Ben Connito
705423e0b3 more entropy on session id
all tests passing
2014-08-07 13:35:01 -04:00
Ben Connito
29e22a0a2e testPrefix passing 2014-08-07 12:34:00 -04:00
Ben Connito
72b1a44e38 add port property to App
allow origins in flash policy server
dont start a flash policy server if one is already running
better CURIE support
on CALL URI should be un prefixed
WampConnection callResult should allow an object to be encoded and sent
2014-08-07 11:56:13 -04:00
bobvandevijver
d16779e24f Change private into protected
This is handy if you want to overwrite the class.
2014-07-09 22:24:53 +02:00
Chris Boden
b6ec4aa904 Merge branch 'refs/heads/master' into 0.4 2014-06-08 11:45:43 -04:00
Chris Boden
d36a8699df Updates for tag 2014-06-08 11:19:45 -04:00
Chris Boden
0dfd2b83b6 Merge pull request #200 from cboden/closing
[WebSocket] Halt communication after closing frame
2014-06-08 11:17:27 -04:00
Chris Boden
1d5af1e34d [WebSocket] Halt communication after closing frame
Also send closing frame in Hixie
2014-06-08 10:55:57 -04:00
Chris Boden
f22f209466 [WAMP] Errors
Cleaned up error handling and tests. refs #190
2014-06-07 11:35:54 -04:00
Chris Boden
f8098db6cc Merge branch 'refs/heads/wamp-errors' 2014-06-07 11:35:24 -04:00
Chris Boden
0a501fef5d Merge branch 'refs/heads/topic-retain' 2014-06-07 11:25:27 -04:00
Chris Boden
989235132e [App] Reverted API API changes - back to v0.3.1 version 2014-06-07 11:09:00 -04:00
Chris Boden
a0db6e6727 Merge branch 'refs/heads/flash-policy-fix' 2014-06-07 10:56:50 -04:00
Chris Boden
a0d858a638 [WAMP] Added autoDelete to Topics 2014-06-05 08:13:35 -04:00
Chris Boden
87de418446 Revert "Revert "Fixed a memory leak when a connection is closed the topics should also be removed if they are empty""
This reverts commit c86fdadcde.
2014-06-04 20:59:10 -04:00
Gerrit Drost
77c6d53a4d Made changes as suggested in pull request. Getters have been removed from IoServer and desired properties have been made public. 2014-06-04 16:59:30 +02:00
Chris Boden
c86fdadcde Revert "Fixed a memory leak when a connection is closed the topics should also be removed if they are empty"
This reverts commit c089aea8eb.
2014-06-03 22:30:40 -04:00
Chris Boden
e1dba72254 Meta for 0.3.1 tag 2014-05-26 22:38:42 -04:00
Gerrit Drost
478bdc10c5 Added a method to expose the flashsocket 2014-05-23 16:31:08 +02:00
Gerrit Drost
cd9a3cb43a Merge branch 'github-master' 2014-05-23 16:22:50 +02:00
Gerrit Drost
5ad295e02a Added a method to clear the allowedAccess array. 2014-05-23 16:22:00 +02:00
Gerrit Drost
a1c27ac91b Added the property socket to the IOServer class and exposed the app and socket properties through getters. 2014-05-23 16:21:13 +02:00
Gerrit Drost
a456c50df4 Reverted the changes previously made in favor of a different approach as requested in https://github.com/cboden/Ratchet/pull/188 2014-05-23 16:20:27 +02:00
Christian Lück
fb1ba88fcc Consistent Exception handling for WAMP protocol errors 2014-05-21 19:48:30 +02:00
Christian Lück
dc9945f2a3 Support bypassing Host check
An empty $httpHost can be passed to circumvent checking Host header.
2014-05-19 15:15:09 +02:00
Gerrit Drost
06c4c3ddd8 PHPDoc formatting fix 2014-05-19 09:36:28 +02:00
Gerrit Drost
ae5e383c02 small change for PHP 5.3 compatibility 2014-05-19 09:28:43 +02:00
Gerrit Drost
cdd6296749 Merge branch 'github-master' 2014-05-19 09:20:34 +02:00
Chris Boden
02a63c180d Merge branch 'refs/heads/hhvm' 2014-05-03 10:30:47 -04:00
Chris Boden
2691f26e9e Merge branch 'refs/heads/pr/cboden-session-refactor' into 0.4 2014-04-20 13:26:07 -04:00
Marc Easen
c089aea8eb Fixed a memory leak when a connection is closed the topics should also be removed if they are empty 2014-04-16 18:52:02 +01:00
Gerrit Drost
97e0122570 Improved comments and changed some parameter definitions/names. 2014-04-15 09:29:17 +02:00
Gerrit Drost
9b38d863b8 Fix app for flash usage 2014-04-14 17:24:36 +02:00
Chris Boden
3aa1892121 [hhvm] remove session serialize handler hack 2014-04-13 12:09:16 -04:00
Chris Boden
1153cfc9d4 Merge branch 'refs/heads/lyrixx-cs' 2014-04-13 11:44:51 -04:00
Grégoire Pineau
136e72d807 CS (trainling space) 2014-03-21 16:46:52 +01:00
Grégoire Pineau
3a8578bd17 CS (eof_ending) 2014-03-21 16:46:43 +01:00
Laurynas Veržukauskas
343ecdfa0f Filter all keys starting with underscore 2014-03-18 22:28:19 +02:00
Vincent Dieltiens
74fb2a691b [Router] Update the Url QueryString of the request object with the parameters return by the UrlMatcher to let the developer access thoses parameters 2014-03-18 22:28:17 +02:00
Chris Boden
f2c67b3460 [Sessions] Trigger error when circumventing HHVM bug 2014-02-17 16:06:37 -05:00
Chris Boden
930130cab3 [Session] Construct/onOpen use HttpServerInterface 2014-02-17 11:29:43 -05:00
Chris Boden
c11ecd9fb4 [Sessions] Decouple interface from WS, align with HTTP 2014-02-17 11:23:35 -05:00
Chris Boden
e1ced856cc Merge branch 'refs/heads/hhvm' 2014-02-17 09:14:31 -05:00
Chris Boden
d884e37c12 [Session] Attempting to fix broken HHVM unit test 2014-02-17 09:04:08 -05:00
Chris Boden
dffb8d2c1f [WAMP] CS, added unit tests for new features, 100% on WAMP 2014-02-16 19:09:54 -05:00
Konstantin Burkalev
48352fce63 Code fix for pull request 165 2014-02-11 11:16:25 +04:00
Konstantin Burkalev
0b5208507f Added subscribers filtering in topic broadcasting for taking into account exclude & eligible data 2014-02-09 00:44:05 +04:00
Chris Boden
3dc69de9d3 Enforce UTF-8 in App (disallow mbstring.func_overload) 2014-02-06 07:54:56 -05:00
Chris Boden
bf61fdbed4 [App] Use trigger_error instead of echo 2014-01-29 06:55:07 -05:00
Kinn Coelho Julião
daaff6c326 gc_enable is not called if running with HHVM
Since HHVM doesn't support garbage collector (for obvious reasons), the following patch make Ratchet works with HHVM as well.
2013-11-28 14:05:20 -05:00
Bramus
b48f0fa6fd Asterisk must be quoted inside array() 2013-11-05 17:34:15 +01:00
Chris Boden
ef5ece0739 [ws] Updated onError handle to make sure to close if conditions aren't met 2013-10-14 10:25:51 -04:00
Chris Boden
78b6e2b6c8 Merge branch 'refs/heads/check' into 0.3 2013-10-14 10:22:29 -04:00
Chris Boden
069133ca35 Updated ops files for 0.3 release 2013-10-14 10:20:32 -04:00
Florian Rey
f40bb94a92 Test for connection attachement before cascading error 2013-10-10 13:40:26 +02:00
Loïc Doignié
1370cb6109 This modification gives Ratchet its own RequestFactory instance.
This way you can use guzzle as REST Client.
2013-10-08 08:51:25 +02:00
Chris Boden
25ff6deb77 [Flash] Close connection after delivering policy 2013-08-05 17:20:05 -04:00
Chris Boden
6559aaf1d4 [Http] Fixed bug in Origin check - browser may pass http:// 2013-08-05 16:23:38 -04:00
Chris Boden
4039a643ea API docs on new features 2013-07-22 21:03:19 -04:00
Chris Boden
eb77cf139e Updated example, slight Origin order change in app 2013-07-20 22:03:46 -04:00
Chris Boden
f50af83fa7 [Http][Security] OriginCheck + same host/origin policy
Added the Http\OriginCheck component that will only allow connections coming from desired Origins
Same host+origin policy by default: App.php, by default, will only allow connections from the given hostname
Fixes #102
2013-07-20 18:41:08 -04:00
Chris Boden
0cf4b614a1 5.5 tests 2013-07-20 14:52:18 -04:00
Chris Boden
5676161277 [WebSocket] Only select one sub-protocol, fixes #103 2013-07-20 12:38:23 -04:00
Chris Boden
9a50835637 [WAMP] Message verification, fixes #105
Validate all messages follow WAMP protocol
2013-07-20 12:31:44 -04:00
Chris Boden
b658ae6e7e Composer restrictions + update 2013-07-20 11:11:34 -04:00
Chris Boden
e7541fdfcf App uses counter for ID instead of random 2013-06-15 14:09:19 -04:00
Chris Boden
0edd37af3f Hostname check verification refs #102
host parameter of App now verified on incoming connections
2013-06-09 14:09:57 -04:00
Chris Boden
40f267834a Merge branch 'refs/heads/master' (v0.2.7) into 0.3
Conflicts:
	CHANGELOG.md
	composer.json
	composer.lock
	src/Ratchet/ConnectionInterface.php
	src/Ratchet/WebSocket/Version/HyBi10.php
	src/Ratchet/WebSocket/Version/RFC6455.php
	src/Ratchet/WebSocket/WsServer.php
2013-06-09 12:04:42 -04:00
Chris Boden
6c0a8550dd Version bump fixes #99 2013-06-09 11:41:03 -04:00
Chris Boden
b21b2007c5 Guzzle 3.6 conformance
Updated inheritance class to match API change
Use new Guzzle Header class when searching for values
Lock Ratchet into using Guzzle 3.6 to future-proof
2013-06-09 11:10:22 -04:00
Chris Boden
b93581cdcd Version bump 2013-06-01 20:25:31 -04:00
Chris Boden
8e92f5fd9a Fixing more Guzzle API breaks 2013-06-01 20:24:11 -04:00
Chris Boden
1a5dd77bb8 Merge branch 'patch-2' of https://github.com/Barbarrosa/Ratchet 2013-06-01 19:49:50 -04:00
Barbarrosa
7bfa2d054e Update HyBi10.php
I encountered the following error while attempting to use Ratchet. The __toString version of the request should contain the proper value, and retrieving the string before converting to an int would prevent this typecasting issue.

Notice: Object of class Guzzle\Http\Message\Header could not be converted to int in [file system path]\vendor\cboden\ratchet\src\Ratchet\WebSocket\Version\HyBi10.php on line 7
2013-05-31 23:08:27 -06:00
Barbarrosa
49c39485e8 Fixed type conversion issue with isProtocol method in RFC6455
I encountered the following error while attempting to use Ratchet. The __toString version of the request contained the correct value (13), so I cast the result to a string before casting it to an integer. 

Notice: Object of class Guzzle\Http\Message\Header could not be converted to int in [file system path]\vendor\cboden\ratchet\src\Ratchet\WebSocket\Version\RFC6455.php on line 53
2013-05-31 22:55:00 -06:00
Chris Boden
f4ddea5f44 Removed updating remoteAddress via proxy header 2013-05-29 07:51:33 -04:00
Chris Boden
8b3591ce0d App class 2013-05-08 20:44:01 -04:00
Chris Boden
37d1339359 [Tests] Refactor AB Fuzzing
AbFuzzyServer is now first class EchoServer
Updated meta files
Cleaned up a WAMP unit test slightly
composer alpha7
2013-05-08 20:32:02 -04:00
Chris Boden
1ff7998f58 [Http] Only update remoteAddress if local and header 2013-05-02 19:17:47 -04:00
Chris Boden
cd0efed085 Set $conn->remoteAddress if proxy forwarded
Refs #89
2013-05-01 19:42:15 -04:00
Chris Boden
1622caadad [Http][Router] Fixed bugs found from unit tests 2013-04-30 21:24:39 -04:00
Chris Boden
344818d0f5 [Tests] Bring up unit testing coverage
Coverage on Http and Session
Set version to 0.3-beta
Cleaned up a couple API doc things
Removed Origin code from RFC, will be moved to Http
2013-04-28 15:25:16 -04:00
Chris Boden
8df459548f [WebSocket][Http] Bug fix WS require nullifying, more strict on Request parameter 2013-04-28 09:55:43 -04:00
Chris Boden
1ea0bd3255 [Http] Cleanup and parse error fix 2013-04-27 16:51:24 -04:00
Chris Boden
5c41b2fbe1 [Http][Tests] Refactored unit tests, added new for HTTP 2013-04-27 10:27:45 -04:00
Chris Boden
26a760709f [Http] Facade class for routing
Not sure if it'll stick or not, but easier way to route for now
Refs #15
2013-04-27 00:05:10 -04:00
Chris Boden
4df71c3a35 [Http] ROUTING BABY
Decoupled routing from HTTP
Added Router implement HttpServerInterface
Fully functional Symfony routes in application!
As a result, this drastically decreased backwards compatibility breaks while introducing new functionality
2013-04-26 23:01:28 -04:00
Chris Boden
c24cdf379e [Http] Accept RouteCollection, spike CORS protection 2013-04-26 21:06:34 -04:00
Chris Boden
4a87375f10 [Http] HttpServerInterface
Force HttpServerInterface on route
Call controller on all events
2013-04-26 20:00:11 -04:00
Chris Boden
43003d69f9 [Http] Only pass Request, don't store (twice) 2013-04-26 19:19:47 -04:00
Chris Boden
18bc114408 [Http] Routing spike 2013-04-16 22:37:15 -04:00
Chris Boden
423b5cc355 [Http] Refactor header parsing from WS to HTTP 2013-04-14 18:34:28 -04:00
Chris Boden
7b2b6897e5 HTTP Decouple spike 2013-04-14 18:23:12 -04:00
Chris Boden
3f64caf8cb Minor doc corrections 2013-04-13 10:55:28 -04:00
Chris Boden
51d2d0b340 Version bump 2013-04-01 19:38:50 -04:00
Chris Boden
92f3844a53 [WebSocket] Prevent division by 0 in Hixie handshake 2013-03-31 14:16:40 -04:00
Chris Boden
3030c81f03 [WebSocket] Fixed Hixie handshake bug (for real this time)
refs #80
2013-03-31 14:02:10 -04:00
Chris Boden
6140c94a33 Cleanup 2013-03-31 11:50:39 -04:00
Chris Boden
7e58dccdb7 Docs 2013-03-31 11:44:10 -04:00
Chris Boden
51f46332ad [WebSocket] Fixed failing Hixie handshake bug
refs #80
2013-03-31 11:41:31 -04:00
Andrey Tokarchuk
41db0c4ed3 Fix misprint error (in word Exception) 2013-03-04 16:05:35 +04:00
Chris Boden
e6622a8e46 [Session] Fixed bug when checking instance type 2013-01-05 16:30:37 -05:00
Chris Boden
e7887a4b17 OCD API documentation updates 2013-01-05 16:10:21 -05:00
Chris Boden
ffd29053bd Minor updates 2013-01-05 13:04:43 -05:00
Chris Boden
75bb5ac891 Cleaning 2013-01-04 19:52:57 -05:00
Chris Boden
786587226e Doc correction 2012-11-25 12:10:39 -05:00
Chris Boden
3a584bfe13 Deps + docs update 2012-11-17 18:31:38 -05:00
Chris Boden
faf3ee26b3 Tagging v0.2.1 2012-10-13 16:37:51 -04:00
Chris Boden
69e3d5a5a2 Merge pull request #52 from pborreli/typos
Fixed typos
2012-10-13 10:53:04 -07:00
Pascal Borreli
ebcc66f1bf Fixed typos 2012-10-11 18:33:29 +00:00
Vladimir Kartaviy
fc17a0b395 Rewritten sub protocols string building 2012-09-22 04:01:28 +03:00
Vladimir Kartaviy
410550b3b2 #49 Fixed WsServer::getSubProtocolString method return value and related unit-test 2012-09-22 01:18:53 +03:00
Chris Boden
eef375ddae v0.2 references 2012-09-07 14:20:05 -04:00
Chris Boden
6b32996b8e [WebSocket] Connection API
All implementations of ConnectionInterface return themselves
2012-07-22 20:05:04 -04:00
Chris Boden
491d0c779c [WAMP] Removed default var from onPublish
Removed default array being set on WampServerInterface::onPublish
These methods are called by Ratchet's event components
Ratchet will never pass null values
This removes excess requirements from the end developer
2012-07-22 20:01:05 -04:00
Chris Boden
6ee81074d3 [WAMP][BCB] Property name change
Changed $conn->WAMP->topics to
$conn->WAMP->subscriptions
2012-07-22 17:55:53 -04:00
Chris Boden
226ec07b02 [WAMP] callError bugfix
callError accepts `$errorUri` as per the specification
It has previously, erroneously, been changed to $topic
Now loosely accepts a URI but can be any data structure that can be json'd

If it is given a topic, as they're to be URIs according to the spec
it will be transformed to a string
2012-07-22 15:17:34 -04:00
Chris Boden
002ae9419c API documentation 2012-07-22 11:25:55 -04:00
Chris Boden
b43c29a183 Micro optimization 2012-07-22 09:46:57 -04:00
Chris Boden
e7e8936b77 Merge branch 'refs/heads/unit-tests' into 0.2-beta 2012-07-20 10:25:18 -04:00
Chris Boden
1505124954 [WAMP] Topic subscription bug fix 2012-07-20 10:23:45 -04:00
Chris Boden
dd8a59df69 [WAMP][Tests] Full namespace coverage
Added `has` method to Topic class
Covering all of WAMP code in unit tests
2012-07-19 11:27:31 -04:00
Chris Boden
4a4e80a945 [Server] Tests
Increased unit test code coverage
Replaced concrete mock objects with PHPUnit mocks
2012-07-19 09:03:07 -04:00
Chris Boden
bd5b7d09aa [WAMP][Tests] Coverage
Sight bug fixes in WAMP topics
Unit tests coverage
2012-07-19 01:38:08 -04:00
Chris Boden
4078a360a8 [WAMP] Topic testing
Fixed bugs failing on Travis
More unit test coverage
2012-07-19 00:14:36 -04:00
Chris Boden
8d0cf5ffb2 [WAMP]
Lots of unit tests for new WAMP classes
Fixed parse error in TopicManager
Aliased Topic::getId -> __toString to WampConnection can work with Topics or raw protocol strings
API docs
CS
2012-07-18 23:55:59 -04:00
Chris Boden
9d0e6735db Merge branch 'refs/heads/0.2-beta' into wamp-topics
Conflicts:
	composer.lock
2012-07-18 20:34:17 -04:00
Chris Boden
b8a677a6bb [WAMP] Topic tests and fix
Fixed a bug in Topic
Created unit tests for Topic
2012-07-17 23:59:35 -04:00
Chris Boden
534375160a [Server] IoServer cleanup
Removed React event loop as a requirement; loop can be run outside
Removed Server as a requirement for Connection; wasn't used anymore
2012-07-17 17:22:51 -04:00
Chris Boden
c5cdd68cef [WAMP] Topic manager
Separated functionality of Ratchet component and topic manager
2012-07-17 17:06:35 -04:00
Chris Boden
5a80a67f03 [WAMP][BCB] Init new serer component
Moved WampServer to ServerProtocol
New WampServer component
New Topic class
2012-07-17 16:57:05 -04:00
Chris Boden
f43ab913c7 [WebSocket] Closing frame bug fix 2012-07-15 12:15:54 -04:00
Chris Boden
3a844edbfd [WebSocket] Performance
No more sprintf calls
2012-07-15 11:57:42 -04:00
Chris Boden
e27ab9891b [WebSocket] Encoding
Added the ability to turn UTF-8 encoding checks off to increase performance
Separated encoding checks into its own set of classes
Encoding checks now use mbstring or iconv depending on availability
2012-07-14 16:44:36 -04:00
Chris Boden
188e9f04ce [Server][WebSocket] Performance
Switched IoServer::factory to use React factory (libevent stable)
Bit operations in Frame for performance gains
Added performance tests back to fuzzing config
2012-07-14 11:58:26 -04:00
Chris Boden
f86230fd16 [WebSocket] Removed deprecated code
Removed some unused Frame code in favour of newer APIs
Removed RFC's Message::frame and Frame::create methods
2012-07-13 19:58:44 -04:00
Chris Boden
dd0040aee9 Micro optimization on RFC Frame 2012-07-13 15:00:00 -04:00
Chris Boden
a2188a449e [WebSocket] Performance
Added unit tests for Rsv bit checks
Using binary operators to check bits resulting in massive performance gains
2012-07-13 11:38:16 -04:00
Chris Boden
5755a5f739 Merge branch 'refs/heads/master' into 0.2-beta 2012-07-13 01:16:08 -04:00
Chris Boden
3c617d96a2 Plugging memory leak
Apparently assigning a property to an object will prevent the object from being destroyed.
Thanks to @igorw to finding this memory leak
2012-07-13 00:55:15 -04:00
Chris Boden
1e298c634b Version tagging 2012-07-12 19:52:04 -04:00
Chris Boden
6d55e18dec mbstring no longer required for Ratchet 2012-07-12 15:41:30 -04:00
Chris Boden
f8a9eb56b5 API docs 2012-07-12 15:21:54 -04:00
Chris Boden
c15c324424 [WebSocket] UTF-8 checking
mb_check_encoding first, as it's much faster, fail fast
Only do the other check if message is under 10k characters
Large payloads crawl otherwise
2012-07-12 13:29:12 -04:00