Jump to content

WebSocket - status 0, can't establish a connection


AddanD

Recommended Posts

I bought a script not so long back and I am trying to install it on my Linux hosting cPanel with GoDaddy.

 

I have followed the installation instructions (below) provided by the script author but I am having no luck.

 

1. Modify server/server.php Line: 282

$master = new ChatBot(“(author's domain)”, 10000);
I changed the domain name and port to my own domain name and port 8080 (also tried 10000).
 
2. Run PHP socket on your server
Linux Server (terminal): php -q /path/server/server.php
I do this and in PuTTY the server says started.
 
3. Modify assets/js/engine.js ws://(author's domain):10000/envato/chatloc/server/server.php”;
I change the domain name again to my own and then change the path to the server.
 
So, why on earth is my Websocket Status showing as 0 in the console? It keeps saying... (in console)
DOMException {message: "Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.", name: "InvalidStateError", code: 11, stack: "Error: Failed to execute 'send' on 'WebSocket': St…(my domain).co.uk/lib/jquery-1.8.2.min.js:1:33875)", INDEX_SIZE_ERR: 1…}
 
ANY HELP WOULD BE HIGHLY APPRECIATED.
Link to comment
Share on other sites

Assuming you are talking about Godaddy's shared hosting, as far as I know, godaddy does not allow you to run continuous processes in the background which is what would be required for your server.php file. It may run for a few minutes, but eventually Godaddy will kill the process.

 

Aside from that, they probably have their firewalls setup to disallow incomming connections on other ports so your web clients would not be able to connect to the server anyway as the connection would be blocked.

 

For what you want to do you'll need a dedicated or VPS server most likely. Something where you can control how it is setup and what is allowed to run.

Link to comment
Share on other sites

Ah HaH!  You 'just uploaded the files' and you expected them to run on the host-provided cpanel screen?  I hate to tell you how far off base you are.  Actually - you probably just misspoke and don't know the difference much like people refer to phpadmin as their database.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.