User tests: Successful: Unsuccessful:
If we try to catch the input for websocket protocol, $_SERVER['REQUEST_METHOD'] is not set and not needed, so this fix check if this variable is set, if not return ''.
Labels |
Added:
?
|
Category | ⇒ | Libraries |
Hi Roland! Thanks very much for testing this!
1) Install a fresh Joomla!
2) Go to https://github.com/fastslack/matware-libraries/releases/tag/1.0.0 and download the library package. Then install it
3) Apply this patch: https://github.com/joomla/joomla-cms/pull/6562.patch
4) Go to console:
cd ${WWWROOT}/cli/WebsocketServer
chmod 755 WebsocketServer
./WebsocketServer
This will open in port 8888 a websocket server
5) Go to site administrator, "Webservices API" > "Websocket example"
6) A angular-js clock should appear. Then go to console and this error will appear too:
Notice: Undefined index: REQUEST_METHOD in /home/fastslack/www/websocket/libraries/joomla/input/input.php on line 301
Hope to be clear, if you have any doubt just ping me.
@fastslack I have tried but failed. On Windows I get this error:
Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 65488 bytes) in D:\wamp\www\joomla-cms\libraries\joomla\filesystem\folder.php on line 219
On my Mac I get the error:
Could not connect to MySQL
Do know that on my Mac I use MAMP which runs on port 8888 and MySQL on port 8889. I changed the port in the Websocket and component to 9888 but to no avail.
On the Mac I see the notice:
Warning: socket_select(): no resource were passed to select in ..../socket/websocket.php on line 97.
@roland-d For the mysql access issue seems that its a path error of the configuration include, try:
https://github.com/fastslack/matware-libraries/blob/master/cli/WebsocketServer/WebsocketServer#L16
-require '../../configuration.php';
+require dirname(dirname(dirname(__FILE__))).'/configuration.php';
The idea is that script read the Joomla! configuration file, try debugging if your path is correct.
For port issue try changing port to 8080. I dont know why it do not work on 'random' ports. I feel that is a problem on the dark side of the moon, i ll never know the origin of the problem.
Take in mind that im only talking about MAMP because i dont know what is that thing called Windows :-P
@roland-d really sorry but i forget one step into testing instruction:
@roland-d I tested it using Windows and latest version of WAMP. The errors seems caused by JLog class of Joomla libraries. If you like to prevent this error you could remove this lines:
https://github.com/fastslack/matware-libraries/blob/master/cli/WebsocketServer/WebsocketServer#L70
If you do that, the websocket script works fine on Windows.
UPDATE: Fix logging bug on WAMP fastslack/matware-libraries@51bb052
@fastslack sorry to report but I still can't get this to run. On the Mac I keep getting the "Could not connect to MySQL" and on Windows I now get "Application Instantiation Error" I have set the port to 8080 and also replace my htacess file with the htaccess file provided by you.
To make sure the correct path is used for the configuration I have even tried with the full path but the MySQL error is still present. Now I found out that this error is caused by the ->loadDispatcher(). When I disable this part the server starts but when going to Websocket Example, the screen remains empty. No clock appears.
I don't know what else to check.
@roland-d the "Application Instantiation Error" message is caused because you didnt applied this patch: https://github.com/joomla/joomla-cms/pull/6562.patch on your Joomla installation.
I havent any Mac here to debug what is the problem with loadDispatcher(), but i think that if you apply the patch, it will work on Windows
@fastslack I did a clean installation and now the server starts. However when I open the Websocket Example I don't see any clock but in the console I see this notice: Warning: socket_select(): no resource arrays were passed to select in D:\wamp\www\joomla-cms\libraries\matware\socket\websocket.php on line 97
In the log I see this:
2015-04-19T14:11:47+00:00 INFO - msocketdaemon > Daemon started : 2015-04-19 16:11:47
2015-04-19T14:11:47+00:00 INFO - msocketdaemon > Master socket : Resource id #93
2015-04-19T14:11:47+00:00 INFO - msocketdaemon > Listening on : 0.0.0.0 port 8888
2015-04-19T14:11:50+00:00 INFO - websocket Resource id #102 CONNECTED
2015-04-19T14:11:50+00:00 INFO - websocket Resource id #102: Processing request
2015-04-19T14:11:50+00:00 INFO - websocket Resource id #102 performing handshake
2015-04-19T14:11:50+00:00 INFO - websocket Disconnecting Resource id #102
2015-04-19T14:11:50+00:00 INFO - websocket Disconnecting Resource id #102
Perhaps you have some idea about this?
@fastslack I am happy to say that I have finally been able to reproduce the issue by using the Chrome webbrowser. Firefox would give the socket issue.
Before the patch, the undefined index would show up, after applying the patch, no more notices.
@fastslack I am using Windows 8.1 with Firefox 37.0.2.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-05-02 15:59:30 |
Closed_By | ⇒ | roland-d |
Thank you for your contribution. Can you please provide test instructions on how to reproduce this issue. Thank you.
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4646.