connectivity with iPhone (Titanium plus https://github.com/iamyellow/tiws)

118 views
Skip to first unread message

Rainer Schleevoigt

unread,
Apr 14, 2013, 2:07:51 PM4/14/13
to ratch...@googlegroups.com
Hi *,

my rachet server works fine between two shell windows.

If I send from iPhone the text 'test', then the following text comes on console:

Connection 44 sending message "GET / HTTP/1.1
Host: lab.min.uni-hamburg.de:8080
Origin: http://lab.min.uni-hamburg.de:8080/
Sec-WebSocket-Key: fkhXEhafOBa2RNwQtLcFGg==
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Version: 13

" to 4 other connections


But I'm aspect:

Connection 44 sending message "test
" to 4 other connections


Whats going wrong?

Rainer

cboden

unread,
Apr 14, 2013, 4:05:56 PM4/14/13
to ratch...@googlegroups.com
Looks like you forgot to put `new WsServer(` between IoServer and your app instantiation. 

Rainer Schleevoigt

unread,
Apr 14, 2013, 4:13:15 PM4/14/13
to ratch...@googlegroups.com
Am Sonntag, 14. April 2013 22:05:56 UTC+2 schrieb cboden:
Looks like you forgot to put `new WsServer(` between IoServer and your app instantiation. 

On Sunday, 14 April 2013 14:07:51 UTC-4, Rainer Schleevoigt wrote:
Hi *,


Thanx, here my server.php:

<?php
use Ratchet\Server\IoServer;
use Cookasa\Event;
require dirname(__DIR__) . '/vendor/autoload.php';

$server = IoServer::factory(new Event(), 8080 );
$server->run();


and here my logic: http://pastie.org/7545173

I dont see my failure.  Do you have an idea.

 

cboden

unread,
Apr 14, 2013, 4:15:52 PM4/14/13
to ratch...@googlegroups.com
Your bin script should be like this:

...
use Ratchet\WebSocket\WsServer;
...
$server = IoServer::factory(new WsServer(new Event()), 8080);
...

Rainer Schleevoigt

unread,
Apr 14, 2013, 4:28:46 PM4/14/13
to ratch...@googlegroups.com
Now I have changed to:

<?php
use Ratchet\Server\IoServer;
use Ratchet\WebSocket\WsServer;

use Cookasa\Event;
require dirname(__DIR__) . '/vendor/autoload.php';
$server = IoServer::factory(
      new WsServer(
            new Event()
           )
        , 8080
      );

$server->run();

After start comes:

PHP Fatal error:  Class 'MyApp\Chat' not found in /opt/cookasa/bin/event-server.php on line 10

In my old version this error did not come.

Rainer



cboden

unread,
Apr 16, 2013, 2:04:11 PM4/16/13
to ratch...@googlegroups.com
Are you running the right script?  There is no "Chat" reference in the code you pasted. 

rks...@gmail.com

unread,
Jul 12, 2017, 10:23:01 AM7/12/17
to Ratchet
Hi Rainer,
where did you find Sec-WebSocket-Key:.
I also need to find this key for my web application. please reply here or mail me at rks...@gmail.com
Thanks
Reply all
Reply to author
Forward
0 new messages