Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$request can not be null #2

Closed
csprocket777 opened this issue Nov 12, 2013 · 6 comments
Closed

$request can not be null #2

csprocket777 opened this issue Nov 12, 2013 · 6 comments

Comments

@csprocket777
Copy link

I'm missing something here. I'm following along with your docs. When I run the start command "sudo php artisan latchet:listen" and I try to make a websocket connection to the server ('ws://localhost:1111') the instance shuts down and echos out
[UnexpectedValueException]
$request can not be null

I used artisan to generate the files and then went to test when I received this error.

@andresnijder
Copy link

Change within the fire method of the ListenCommand class the following:

$webServer = new \Ratchet\Server\IoServer(
new \Ratchet\WebSocket\WsServer(
new \Ratchet\Wamp\WampServer(
$this->latchet
)
), $webSock
);

to

$webServer = new \Ratchet\Server\IoServer(
new \Ratchet\Http\HttpServer(
new \Ratchet\WebSocket\WsServer(
new \Ratchet\Wamp\WampServer(
$this->latchet
)
)
), $webSock
);

now it should work...

@csprocket777
Copy link
Author

this creates a huge amount of recursion. This doesn't solve the issue.

@csprocket777
Copy link
Author

Is there something I'm missing about this change? I made the change to the file specified, then reuploaded it to my server, I still get errors. Help?

@CedricGeerinckx
Copy link

I have the same issue.

@lokielse
Copy link

+1

@lokielse
Copy link

solved. just chang the code to follow.

.\vendor\sidney\latchet\src\commands\ListenCommand.php in fire() method.

 $webServer = new \Ratchet\Server\IoServer(
            new \Ratchet\Http\HttpServer(
                new \Ratchet\WebSocket\WsServer(
                    new \Ratchet\Wamp\WampServer(
                        $this->latchet
                    )
                )
            ),
            $webSock
        );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants