johnnymast / mysql_websocket_chat

Quickly get a websocket chat up and running
MIT License
21 stars 11 forks source link

Socket Close Abnormally 1006 #47

Open sonawanesarvesh opened 3 years ago

sonawanesarvesh commented 3 years ago

Hello, I followed your deployment instruction on one web server, but I am getting this error

WebSocket connection to 'wss://myIP:8080/' failed: We have received an error! Event {isTrusted: true, type: "error", target: WebSocket, currentTarget: WebSocket, eventPhase: 2, …} Connection closed with event code 1006 => The connection was closed abnormally, e.g., without sending or receiving a Close control frame

johnnymast commented 3 years ago

Hi there,

I am sorry for my late response. Are you running the server script in the background?

LP233 commented 3 years ago

I'm also getting same error terminal front

johnnymast commented 3 years ago

Allright boys, let me check it out.

johnnymast commented 3 years ago

Hi guys,

I see that you guys are using wss:// (secure) but the 1.4 version does not support SSL (yet). The upcoming milestone (1.5 Add more security to the chats) will feature SSL and docker support for the project. You can follow the link to track the progress.

sonawanesarvesh commented 3 years ago

Hello, thanks for the updates, but I see no latest comments on https://github.com/johnnymast/mysql_websocket_chat/issues/8

is it stalled since long? is there any hopes to see updates in some days (not in weeks :) )

johnnymast commented 3 years ago

That's right it's a ticket I added for the v1.5 milestone. I have 98 repo's to maintain so I didn't come to it (yet) but since yesterday I have been working on the 1.5 branch again. If you wish to help, all help is welcome :)

sonawanesarvesh commented 3 years ago

Hello my team tried to work on https://stackoverflow.com/questions/53989596/unable-to-connect-to-websocket-using-wss-in-php https://www.php.net/manual/en/class.streamwrapper.php

Just wanted confirm the right direction?

johnnymast commented 3 years ago

Hi sonawanesarvesh,

I can't really tell because mysql_websocket_chat uses a third-party WebSocket server and I don't know what it does in its core. But for version 1.5 I am adding certs creator to the package.

https://github.com/johnnymast/mysql_websocket_chat/blob/v1.5/ssl/cert.php

Maybe if you have certs you know are 100% valid you could help me test version 1.5 before release. You can do so by updating this line in the server https://github.com/johnnymast/mysql_websocket_chat/blob/v1.5/server.php#L9 and enable SSL support here https://github.com/johnnymast/mysql_websocket_chat/blob/v1.5/includes/config.php#L25 (Don't forget to download the 1.5 branch the other branches/versions don't have this option.

johnnymast commented 3 years ago

@sonawanesarvesh I have the solution but I can not work with the version of mysql_websocket_chat you work with now. Really soon I will release 1.5 pre-release with SSL support. I had to debug Ratched WebSockets head to toe to see why it doesn't like SSL in 1.5. This took a while but I got it done now. Expect a pre-release + youtube video soon to fix this.