? Success

User tests: Successful: Unsuccessful:

avatar fastslack
fastslack
12 Oct 2014

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

avatar fastslack fastslack - open - 12 Oct 2014
avatar jissues-bot jissues-bot - change - 12 Oct 2014
Labels Added: ?
avatar brianteeman brianteeman - change - 17 Oct 2014
Category Libraries
avatar roland-d
roland-d - comment - 15 Mar 2015

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.
avatar fastslack
fastslack - comment - 23 Mar 2015

Hi Roland! Thanks very much for testing this!

Testing instructions

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.

avatar roland-d
roland-d - comment - 24 Mar 2015

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

avatar fastslack
fastslack - comment - 25 Mar 2015

@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

avatar fastslack
fastslack - comment - 31 Mar 2015

@roland-d really sorry but i forget one step into testing instruction:

avatar fastslack
fastslack - comment - 16 Apr 2015

@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

avatar roland-d
roland-d - comment - 18 Apr 2015

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

avatar fastslack
fastslack - comment - 18 Apr 2015

@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

avatar roland-d
roland-d - comment - 19 Apr 2015

@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?

avatar fastslack
fastslack - comment - 20 Apr 2015

@roland-d I cant reproduce the notice. What browser are you using?

Also, for better debug on javascript you can uncomment this line and check the results on your browser console log:

https://github.com/fastslack/matware-libraries/blob/master/administrator/components/com_webservices/views/websocket/tmpl/default.php#L60

avatar roland-d
roland-d - comment - 28 Apr 2015

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


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4646.

avatar roland-d roland-d - test_item - 28 Apr 2015 - Tested successfully
avatar fastslack
fastslack - comment - 29 Apr 2015

@roland-d which version of firefox are you using? i like to fix that problem too :) Im very happy too. Thanks very much for testing it. If you need more information about how to extend the websocket and angularjs code just contact me :)

avatar roland-d
roland-d - comment - 30 Apr 2015

@fastslack I am using Windows 8.1 with Firefox 37.0.2.

avatar zero-24
zero-24 - comment - 1 May 2015

@fastslack

I have just tested this here and after the both patches it works good here in Chrome. If i use the last firefox i get the same error as @roland-d (also on a Windows 8.1 host)

avatar roland-d roland-d - change - 2 May 2015
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-05-02 15:59:30
Closed_By roland-d
avatar roland-d roland-d - close - 2 May 2015

Add a Comment

Login with GitHub to post a comment