Coder Social home page Coder Social logo

Another SSL question about pawl HOT 11 CLOSED

ratchetphp avatar ratchetphp commented on July 25, 2024 1
Another SSL question

from pawl.

Comments (11)

MrMoronIV avatar MrMoronIV commented on July 25, 2024 2

I opted to go with a NodeJS socket.io server instead, much better than PHP for a socket, and much easier to setup.

from pawl.

clue avatar clue commented on July 25, 2024 1

Straight from the documentation linked above:

// allow insecure TLS connections
$connector = new Connector($loop, array(
    'tcp' => array(
        'bindto' => '192.168.0.1:0'
    ),
    'tls' => array(
        'verify_peer' => false,
        'verify_peer_name' => false
    ),
));

from pawl.

clue avatar clue commented on July 25, 2024

It looks like you're missing the tls key for your context passed to the Connector, see also https://github.com/reactphp/socket#connector 👍

from pawl.

MrMoronIV avatar MrMoronIV commented on July 25, 2024

you mean 'tls' => true, in the connector ssl array? Didn't change a thing...

from pawl.

MrMoronIV avatar MrMoronIV commented on July 25, 2024

that actually does the trick, thank you

from pawl.

MrMoronIV avatar MrMoronIV commented on July 25, 2024

Follow up question, the connectoin seems to be closed immediately,
$conn->send('Hello World!');
is actually never sent to the server, any idea why that happens?
It just says connection closed (code 1000) normal closure

from pawl.

MrMoronIV avatar MrMoronIV commented on July 25, 2024

My ratchet server has this function in the app (which works great when a browser is connected)

	public function onMessage(ConnectionInterface $conn, $msg) 
	{
		var_dump($msg);

the dump never gets called when i run the above pawl script.
It gets sent by the Websocket class (it shows a var_dump in the send function), could it be that the handshake fails (verify_peer = false) thus the data gets ignored cause in wrong format or is that nonsene?

from pawl.

mbonneau avatar mbonneau commented on July 25, 2024

@MrMoronIV It is hard to say what the problem is without more info.

Can you post the sources for your client?

from pawl.

mbonneau avatar mbonneau commented on July 25, 2024

@MrMoronIV I am closing this because it is old. If you are still having issues, feel free to reopen.

from pawl.

mayanktiwaridotcom avatar mayanktiwaridotcom commented on July 25, 2024

@MrMoronIV I had exactly the same problem as you mentioned in this issue, and solved is when found this, but now i get unable to write to stream: fwrite(): ssl operation failed with code 1 even though messages are being sent. can you share your working code so I can verify what did I miss.

ratchetphp/Ratchet#799 (comment)

this is what I was doing originally before finding this thread.

from pawl.

khasman avatar khasman commented on July 25, 2024

Hi, I tried to integrate the setup by following official integration, but it just throwing class not found error. Can anyone share the way fwd to fix this issue

chat-server.php


run(); Error: ______ PHP Fatal error: Uncaught Error: Class 'Ratchet\Server\IoServer' not found in /var/www/html/reactchat/chat-server.php:10

from pawl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.