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.

if you purchased the script you should speak to the person you bought it from. No one here is going to be able to help you without knowing what the script is doing

http://codecanyon.net/item/chatloc-chat-with-nearby/5640785 is the script and there is a live demo if that is any help?

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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.